-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform.cs
More file actions
55 lines (46 loc) · 1.36 KB
/
form.cs
File metadata and controls
55 lines (46 loc) · 1.36 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
47
48
49
50
51
52
53
54
55
using System.Reflection.Emit;
public class Form
{
}public class MyForm : Form
{
private System.Reflection.Emit.Label label1;
private TextBox textBox1;
private Button button1;
public MyForm()
{
// Initialize the components of the form
this.label1 = new Label();
this.label1.Text = "Enter your name:";
this.label1.Location = new System.Drawing.Point(10, 10);
this.Controls.Add(this.label1);
this.textBox1 = new TextBox();
this.textBox1.Location = new System.Drawing.Point(10, 30);
this.Controls.Add(this.textBox1);
this.button1 = new Button();
this.button1.Text = "Say Hello";
this.button1.Location = new System.Drawing.Point(10, 60);
this.button1.Click += new EventHandler(button1_Click);
this.Controls.Add(this.button1);
// Set the properties of the form
this.Text = "My Form";
this.Size = new System.Drawing.Size(200, 150);
}
public object Controls { get; }
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Hello, " + this.textBox1.Text + "!");
}
}
internal class Button
{
public string Text { get; internal set; }
}
public class Program
{
[STAThread]
public static void Main()
{
Application.EnableVisualStyles();
Application.Run(new MyForm());
}
}