radiobox、checkbox和validating事件的相关处理…

2008-02-23 05:42:15来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

[示例出处]:本示例来自《C#入门经典》第三版中文版,P349-P353
[示例涉及]:
1、RadioBox、CheckBox控件的基本使用
2、Validating事件的使用(同[C#][SAMPLE][CODE][Control]TextBox和Validating事件的相关处理 )
3、多委托处理同一事件方法(同[C#][SAMPLE][CODE][Control]TextBox和Validating事件的相关处理 )
[示例代码]:2文档(其余默认)

Form1.Designer.cs
1namespace WA_TextBoxTest
2{
3 partial class Form1
4 {
5 /**//// <summary>
6 /// 必需的设计器变量。
7 /// </summary>
8 private System.ComponentModel.IContainer components = null;
9
10 /**//// <summary>
11 /// 清理任何正在使用的资源。
12 /// </summary>
13 /// <param name="disposing">假如应释放托管资源,为 true;否则为 false。</param>
14 protected override void Dispose(bool disposing)
15 {
16 if (disposing && (components != null))
17 {
18 components.Dispose();
19 }
20 base.Dispose(disposing);
21 }
22
23 Windows 窗体设计器生成的代码#region Windows 窗体设计器生成的代码
24
25 /**//// <summary>
26 /// 设计器支持所需的方法 - 不要
27 /// 使用代码编辑器修改此方法的内容。
28 /// </summary>
29 private void InitializeComponent()
30 {
31 this.label1 = new System.Windows.Forms.Label();
32 this.label2 = new System.Windows.Forms.Label();
33 this.textBoxName = new System.Windows.Forms.TextBox();
34 this.textBoxAddress = new System.Windows.Forms.TextBox();
35 this.textBoxAge = new System.Windows.Forms.TextBox();
36 this.textBoxOutput = new System.Windows.Forms.TextBox();
37 this.label4 = new System.Windows.Forms.Label();
38 this.label5 = new System.Windows.Forms.Label();
39 this.buttonOK = new System.Windows.Forms.Button();
40 this.buttonHelp = new System.Windows.Forms.Button();
41 this.checkBoxProgrammer = new System.Windows.Forms.CheckBox();
42 this.groupBoxSex = new System.Windows.Forms.GroupBox();
43 this.radioButtonMale = new System.Windows.Forms.RadioButton();
44 this.radioButtonFemale = new System.Windows.Forms.RadioButton();
45 this.groupBoxSex.SuspendLayout();
46 this.SuspendLayout();
47 //
48 // label1
49 //
50 this.label1.AutoSize = true;
51 this.label1.Location = new System.Drawing.Point(26, 27);
52 this.label1.Name = "label1";
53 this.label1.Size = new System.Drawing.Size(59, 12);
54 this.label1.TabIndex = 0;
55 this.label1.Text = "labelName";
56 //
57 // label2
58 //
59 this.label2.AutoSize = true;
60 this.label2.Location = new System.Drawing.Point(26, 53);
61 this.label2.Name = "label2";
62 this.label2.Size = new System.Drawing.Size(77, 12);
63 this.label2.TabIndex = 1;
64 this.label2.Text = "labelAddress";
65 //
66 // textBoxName
67 //
68 this.textBoxName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
69 | System.Windows.Forms.AnchorStyles.Right)));
70 this.textBoxName.Location = new System.Drawing.Point(127, 24);
71 this.textBoxName.Name = "textBoxName";
72 this.textBoxName.Size = new System.Drawing.Size(317, 21);
73 this.textBoxName.TabIndex = 2;
74 //
75 // textBoxAddress
76 //
77 this.textBoxAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
78 | System.Windows.Forms.AnchorStyles.Right)));
79 this.textBoxAddress.Location = new System.Drawing.Point(127, 50);
80 this.textBoxAddress.Multiline = true;
81 this.textBoxAddress.Name = "textBoxAddress";
82 this.textBoxAddress.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
83 this.textBoxAddress.Size = new System.Drawing.Size(317, 102);
84 this.textBoxAddress.TabIndex = 2;
85 //
86 // textBoxAge
87 //
88 this.textBoxAge.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
89 | System.Windows.Forms.AnchorStyles.Right)));
90 this.textBoxAge.Location = new System.Drawing.Point(127, 254);
91 this.textBoxAge.Name = "textBoxAge";

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇: c# gridview 排序及分页_c#应用

下一篇: c#2.0新的语法扩充(泛型,迭代器,匿名方法) _c#应用