c# windows程序,如何在单击ok时显示输入的信息。 还有,如何单击按钮或一个菜单项时能弹出另外一个窗体
privatevoidbutton1_Click(objectsender,EventArgse){stringname="";stringsex="";stringxu...
private void button1_Click(object sender, EventArgs e)
{
string name = "";
string sex = "";
string xueli = "";
string minzhu = "";
string phone = "";
string address = "";
name = this.textBox2.Text.ToString().Trim();
sex = this.radioButton1.Text.ToString().Trim();
xueli = this.comboBox2.Text.ToString().Trim();
minzhu = this.comboBox1.Text.ToString().Trim();
phone = this.textBox1.Text.ToString().Trim();
address = this.textBox3.Text.ToString().Trim();
if (name.Length <= 0 || xueli.Length <= 0 || minzhu.Length <= 0 || phone.Length <= 0 || address.Length <= 0 || (radioButton1.Checked == false && radioButton2.Checked == false))
{
MessageBox.Show("信息不能为空!", "提示");
return;
}
//然后怎么写?在单击OK按钮后弹出messageBox能显示填写的信息。
类似“姓名:*** \n 性别:** \n爱好: **“这样的,*号为刚输入的信息,其他为添上去的
如图 展开
{
string name = "";
string sex = "";
string xueli = "";
string minzhu = "";
string phone = "";
string address = "";
name = this.textBox2.Text.ToString().Trim();
sex = this.radioButton1.Text.ToString().Trim();
xueli = this.comboBox2.Text.ToString().Trim();
minzhu = this.comboBox1.Text.ToString().Trim();
phone = this.textBox1.Text.ToString().Trim();
address = this.textBox3.Text.ToString().Trim();
if (name.Length <= 0 || xueli.Length <= 0 || minzhu.Length <= 0 || phone.Length <= 0 || address.Length <= 0 || (radioButton1.Checked == false && radioButton2.Checked == false))
{
MessageBox.Show("信息不能为空!", "提示");
return;
}
//然后怎么写?在单击OK按钮后弹出messageBox能显示填写的信息。
类似“姓名:*** \n 性别:** \n爱好: **“这样的,*号为刚输入的信息,其他为添上去的
如图 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询