文件名称:示例在form窗体中进行如下操作-C# WinForm实践开发教程
文件大小:2.55MB
文件格式:PPT
更新时间:2024-05-14 20:34:18
C# WinForm实践开发教程
示例1:在form2窗体中进行如下操作 单击“发送”按钮 form2的设计 private void Form2_Load(object sender, EventArgs e) { comboBox1.SelectedIndex = 0; textBox3.Text = ""; textBox1.Focus(); } public void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "" || textBox2.Text == "" || comboBox1.Text == "") { MessageBox.Show("姓名,或者邮件,或者提交,信息禁止为空!", "信息提示"); } else { string str = "姓名:" + textBox1.Text + "\n 邮件地址:" + textBox2.Text + "\n 信息主题:" + comboBox1.Text + "\n 反馈意见:" + textBox3.Text; this.Hide(); Form3 childform3 = new Form3(); childform3.Show(); } } form3的设计 private void Form3_Load(object sender, EventArgs e) { Form2 f2 = new Form2(); f2.te }