RadioBox、CheckBox和Validating事件的相关处理
|
日期:2006年12月18日 作者: 查看:[大字体
中字体 小字体]
|
235 private System.Windows.Forms.GroupBox groupBoxSex; 236 private System.Windows.Forms.RadioButton radioButtonMale; 237 private System.Windows.Forms.RadioButton radioButtonFemale; 238 } 239} 240 241 Form1.cs 1using System; 2using System.Collections.Generic; 3using System.ComponentModel; 4using System.Data; 5using System.Drawing; 6using System.Text; 7using System.Windows.Forms; 8 9namespace WA_TextBoxTest 10{ 11 public partial class Form1 : Form 12 { 13 public Form1() 14 { 15 InitializeComponent(); 16 this.buttonOK.Enabled = false; 17 18 //Tag values for testing if the data is valid. 19 this.textBoxName.Tag = false; 20 this.textBoxAddress.Tag = false; 21 this.textBoxAge.Tag = false; 22 23 //订阅事件Subscriptions to events 24 this.textBoxName.Validating += new CancelEventHandler(this.textBoxEmpty_Validating); 25 this.textBoxAddress.Validating += new CancelEventHandler(this.textBoxEmpty_Validating); 26 this.textBoxAge.Validating += new CancelEventHandler(this.textBoxEmpty_Validating); 27 28 //当控件中文本发生改变,就激发TextChanged事件。 29 this.textBoxName.TextChanged +=new EventHandler(textBox_TextChanged); 30 this.textBoxAddress.TextChanged+=new EventHandler(textBox_TextChanged);
上一篇:一个读取扩展名为xml的资源文件的方法
下一篇:xml文件调用css
|
| RadioBox、CheckBox和Validating事件的相关处理 相关文章: |
|
|
|
| RadioBox、CheckBox和Validating事件的相关处理 相关软件: |
|
|
|