RadioBox、CheckBox和Validating事件的相关处理
|
日期:2006年12月18日 作者: 查看:[大字体
中字体 小字体]
|
31 this.textBoxAge.TextChanged += new EventHandler(textBox_TextChanged); 32 } 33 34 private void buttonOK_Click(object sender, EventArgs e) 35 { 36 //No testing for invalid values are made ,as that should not be necessary 37 string output; 38 39 //Concatenate the text values of for TextBoxes. 40 output = "Name:" + this.textBoxName.Text + "\r\n"; 41 output += "Address:" + this.textBoxAddress.Text + "\r\n"; 42 output += "Occupation:" + (string)(this.checkBoxProgrammer.Checked ? 43 "Programmer" : "Not a programmer") + "\r\n"; //此句等价于下面这句 44 output += "Occupation:" + (string)(this.checkBoxProgrammer.Checked ? 45 this.checkBoxProgrammer.Text : ("Not a "+this.checkBoxProgrammer.Text)) + "\r\n"; 46 output += "Sex:" + (string)(this.radioButtonFemale.Checked ? 47 "Female" : "Male") + "\r\n"; //此句等价于下面这句 48 output += "Sex:" + (string)(this.radioButtonFemale.Checked ? 49 this.radioButtonFemale.Text : this.radioButtonMale.Text) + "\r\n"; 50 output += "Age:" + this.textBoxAge.Text; 51 52 //Insert the new text.
上一篇:一个读取扩展名为xml的资源文件的方法
下一篇:xml文件调用css
|
| RadioBox、CheckBox和Validating事件的相关处理 相关文章: |
|
|
|
| RadioBox、CheckBox和Validating事件的相关处理 相关软件: |
|
|
|