-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathControl.cs
More file actions
26 lines (22 loc) · 769 Bytes
/
Control.cs
File metadata and controls
26 lines (22 loc) · 769 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
using System;
using System.Windows.Forms;
namespace Examples {
class MainForm : Form {
public static void Main() {
Application.EnableVisualStyles();
Application.Run(new MainForm());
}
public MainForm() {
Text = "Control example";
control1.Parent = this;
control1.BackColor = System.Drawing.Color.SpringGreen;
control1.Cursor = Cursors.Hand;
control1.Location = new System.Drawing.Point(50, 50);
control1.Size = new System.Drawing.Size(100, 50);
control1.Click += delegate {
control1.BackColor = control1.BackColor == System.Drawing.Color.SpringGreen ? System.Drawing.Color.OrangeRed : System.Drawing.Color.SpringGreen;
};
}
private Control control1 = new Control();
}
}