-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathNumericUpDown.cs
More file actions
37 lines (31 loc) · 1.13 KB
/
NumericUpDown.cs
File metadata and controls
37 lines (31 loc) · 1.13 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
using System;
using System.Windows.Forms;
namespace Examples {
class MainForm : Form {
public static void Main() {
Application.EnableVisualStyles();
Application.Run(new MainForm());
}
public MainForm() {
Text = "NumericUpDown example";
numericUpDown1.Parent = this;
numericUpDown1.DecimalPlaces = 0;
numericUpDown1.Location = new System.Drawing.Point(80, 50);
numericUpDown1.Value = 50;
numericUpDown1.ValueChanged += delegate {
System.Diagnostics.Debug.WriteLine(string.Format("value = {0}", numericUpDown1.Value));
};
numericUpDown1.TextChanged += delegate {
System.Diagnostics.Debug.WriteLine(string.Format("text = {0}", numericUpDown1.Text));
};
numericUpDown2.Parent = this;
numericUpDown2.DecimalPlaces = 2;
numericUpDown2.Increment = 0.01M;
numericUpDown2.Location = new System.Drawing.Point(80, 100);
numericUpDown2.Maximum = 11.0M;
numericUpDown2.Minimum = 10.0M;
}
private NumericUpDown numericUpDown1 = new NumericUpDown();
private NumericUpDown numericUpDown2 = new NumericUpDown();
}
}