1
using
System;
2 using System.Drawing;
3 using System.Collections;
4 using System.Windows.Forms;
5 using System.Data;
6
7 namespace NETCFDevelopersReference
8 {
9 /**//// <summary>
10 /// Summary description for Form1.
11 /// </summary>
12 public class Form1 : System.Windows.Forms.Form
13 {
14 private System.Windows.Forms.DomainUpDown domainUpDown1;
15 private System.Windows.Forms.Label label1;
16 private System.Windows.Forms.Label label2;
17 private System.Windows.Forms.MainMenu mainMenu1;
18
19 public Form1()
20 {
21 //
22 // Required for Windows Form Designer support
23 //
24 InitializeComponent();
25
26 //
27 // TODO: Add any constructor code after InitializeComponent call
28 //
29 }
30 /**//// <summary>
31 /// Clean up any resources being used.
32 /// </summary>
33 protected override void Dispose( bool disposing )
34 {
35 base.Dispose( disposing );
36 }
37 Windows Form Designer generated code#region Windows Form Designer generated code
38 /**//// <summary>
39 /// Required method for Designer support - do not modify
40 /// the contents of this method with the code editor.
41 /// </summary>
42 private void InitializeComponent()
43 {
44 this.mainMenu1 = new System.Windows.Forms.MainMenu();
45 this.domainUpDown1 = new System.Windows.Forms.DomainUpDown();
46 this.label1 = new System.Windows.Forms.Label();
47 this.label2 = new System.Windows.Forms.Label();
48 //
49 // domainUpDown1
50 //
51 this.domainUpDown1.Location = new System.Drawing.Point(64, 96);
52 this.domainUpDown1.ReadOnly = true;
53 this.domainUpDown1.Size = new System.Drawing.Size(136, 20);
54 this.domainUpDown1.SelectedItemChanged += new System.EventHandler(this.domainUpDown1_SelectedItemChanged);
55 //
56 // label1
57 //
58 this.label1.Location = new System.Drawing.Point(64, 136);
59 this.label1.Text = "label1";
60 //
61 // label2
62 //
63 this.label2.Location = new System.Drawing.Point(64, 176);
64 this.label2.Text = "label2";
65 //
66 // Form1
67 //
68 this.ClientSize = new System.Drawing.Size(240, 270);
69 this.Controls.Add(this.label2);
70 this.Controls.Add(this.label1);
71 this.Controls.Add(this.domainUpDown1);
72 this.Menu = this.mainMenu1;
73 this.MinimizeBox = false;
74 this.Text = "Form1";
75 this.Load += new System.EventHandler(this.Form1_Load);
76
77 }
78 #endregion
79
80 /**//// <summary>
81 /// The main entry point for the application.
82 /// </summary>
83
84 static void Main()
85 {
86 Application.Run(new Form1());
87 }
88
89 private void Form1_Load(object sender, System.EventArgs e)
90 {
91 domainUpDown1.Items.Add("Item 1");
92 domainUpDown1.Items.Add("Item 2");
93 domainUpDown1.Items.Add("Item 3");
94 domainUpDown1.Items.Add("Item 4");
95 domainUpDown1.ReadOnly = false;
96 }
97
98 private void domainUpDown1_SelectedItemChanged(object sender, System.EventArgs e)
99 {
100 label1.Text = domainUpDown1.SelectedIndex.ToString();
101 label2.Text = domainUpDown1.Items[domainUpDown1.SelectedIndex].ToString();
102 }
103 }
104}
105
2 using System.Drawing;
3 using System.Collections;
4 using System.Windows.Forms;
5 using System.Data;
6
7 namespace NETCFDevelopersReference
8 {
9 /**//// <summary>
10 /// Summary description for Form1.
11 /// </summary>
12 public class Form1 : System.Windows.Forms.Form
13 {
14 private System.Windows.Forms.DomainUpDown domainUpDown1;
15 private System.Windows.Forms.Label label1;
16 private System.Windows.Forms.Label label2;
17 private System.Windows.Forms.MainMenu mainMenu1;
18
19 public Form1()
20 {
21 //
22 // Required for Windows Form Designer support
23 //
24 InitializeComponent();
25
26 //
27 // TODO: Add any constructor code after InitializeComponent call
28 //
29 }
30 /**//// <summary>
31 /// Clean up any resources being used.
32 /// </summary>
33 protected override void Dispose( bool disposing )
34 {
35 base.Dispose( disposing );
36 }
37 Windows Form Designer generated code#region Windows Form Designer generated code
38 /**//// <summary>
39 /// Required method for Designer support - do not modify
40 /// the contents of this method with the code editor.
41 /// </summary>
42 private void InitializeComponent()
43 {
44 this.mainMenu1 = new System.Windows.Forms.MainMenu();
45 this.domainUpDown1 = new System.Windows.Forms.DomainUpDown();
46 this.label1 = new System.Windows.Forms.Label();
47 this.label2 = new System.Windows.Forms.Label();
48 //
49 // domainUpDown1
50 //
51 this.domainUpDown1.Location = new System.Drawing.Point(64, 96);
52 this.domainUpDown1.ReadOnly = true;
53 this.domainUpDown1.Size = new System.Drawing.Size(136, 20);
54 this.domainUpDown1.SelectedItemChanged += new System.EventHandler(this.domainUpDown1_SelectedItemChanged);
55 //
56 // label1
57 //
58 this.label1.Location = new System.Drawing.Point(64, 136);
59 this.label1.Text = "label1";
60 //
61 // label2
62 //
63 this.label2.Location = new System.Drawing.Point(64, 176);
64 this.label2.Text = "label2";
65 //
66 // Form1
67 //
68 this.ClientSize = new System.Drawing.Size(240, 270);
69 this.Controls.Add(this.label2);
70 this.Controls.Add(this.label1);
71 this.Controls.Add(this.domainUpDown1);
72 this.Menu = this.mainMenu1;
73 this.MinimizeBox = false;
74 this.Text = "Form1";
75 this.Load += new System.EventHandler(this.Form1_Load);
76
77 }
78 #endregion
79
80 /**//// <summary>
81 /// The main entry point for the application.
82 /// </summary>
83
84 static void Main()
85 {
86 Application.Run(new Form1());
87 }
88
89 private void Form1_Load(object sender, System.EventArgs e)
90 {
91 domainUpDown1.Items.Add("Item 1");
92 domainUpDown1.Items.Add("Item 2");
93 domainUpDown1.Items.Add("Item 3");
94 domainUpDown1.Items.Add("Item 4");
95 domainUpDown1.ReadOnly = false;
96 }
97
98 private void domainUpDown1_SelectedItemChanged(object sender, System.EventArgs e)
99 {
100 label1.Text = domainUpDown1.SelectedIndex.ToString();
101 label2.Text = domainUpDown1.Items[domainUpDown1.SelectedIndex].ToString();
102 }
103 }
104}
105