C# 经典入门15章 RadioButton和CheckBox

buttonOK的代码修改:

private void button3_Click(object sender, EventArgs e)
        {
             string output;
            output = "Name:" + this.textBoxName.Text + "\r\n";
            output += "Address:" + this.textBoxAddress.Text + "\r\n";
           output += "职业:" + (string)(this.checkBox1.Checked ? "Programmer":"Not a programmer") + "\r\n";
           output += "Sex:" + (string)(this.radioButton1.Checked ? "Female" : "Male") + "\r\n";
            output += "年龄:" + this.textBoxAge.Text + "\r\n";



           this.textBoxOutPut.Text = output;
        }
       

ButtonHelp的代码修改

 private void button4_Click(object sender, EventArgs e)
        {
            string output;
            output = "Name=YourName\r\n";
            output += "Address=Your address\r\n";
            output += "programer=Check 'Programmer' if you are a programer \r\n";
            output += "Sex = Choose your sex\r\n";
            output += "Age=Your age";
            this.textBoxOutPut.Text = output;
        }

 

 

 

posted @ 2013-07-20 14:33  秋水惜朝  阅读(160)  评论(0编辑  收藏  举报