-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTextBox.cs
More file actions
37 lines (31 loc) · 936 Bytes
/
TextBox.cs
File metadata and controls
37 lines (31 loc) · 936 Bytes
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
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace Examples {
class MainForm : Form {
public static void Main() {
Application.EnableVisualStyles();
Application.Run(new MainForm());
}
public MainForm() {
Text = "TextBox example";
textBox1.Parent = this;
textBox1.Text = "textBox1";
textBox1.Location = new System.Drawing.Point(10, 10);
textBox2.Parent = this;
textBox2.Text = "textBox2";
textBox2.Location = new System.Drawing.Point(10, 50);
textBox2.GotFocus += delegate {
Debug.WriteLine(string.Format("Got Focus"));
};
textBox2.LostFocus += delegate {
Debug.WriteLine(string.Format("Lost Focus"));
};
ActiveControl = textBox2;
//textBox2.Select();
//textBox2.Focus();
}
private TextBox textBox1 = new TextBox();
private TextBox textBox2 = new TextBox();
}
}