-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cs
More file actions
46 lines (39 loc) · 1.38 KB
/
Main.cs
File metadata and controls
46 lines (39 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApp2
{
public partial class Main : Form
{
public Main()
{
InitializeComponent();
}
private Size m_Initial_Size_Form;
private Point m_Initial_Location_Load;
private Size m_Initial_Size_Url;
private Size m_Initial_Size_WebView;
private void Form1_Load(object sender, EventArgs e)
{
m_Initial_Size_Form = this.Size;
m_Initial_Location_Load = m_Load.Location;
m_Initial_Size_Url = m_Url.Size;
m_Initial_Size_WebView = m_WebView.Size;
}
private void Form1_Resize(object sender, EventArgs e)
{
var adjust = this.Size - m_Initial_Size_Form;
m_Load.Location = new Point(m_Initial_Location_Load.X + adjust.Width, m_Initial_Location_Load.Y);
m_Url.Size = new Size(m_Initial_Size_Url.Width + adjust.Width, m_Initial_Size_Url.Height + adjust.Height);
m_WebView.Size = new Size(m_Initial_Size_WebView.Width + adjust.Width, m_Initial_Size_WebView.Height + adjust.Height);
}
private void OnLoadClicked(object sender, EventArgs e)
{
var url = m_Url.Text;
if (!string.IsNullOrEmpty(url))
{
m_WebView.LoadUrl(url);
}
}
}
}