新手!为什么控件提交不了
为什么就是提交不了,该怎么改?谢谢指教!using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsExample1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{ }
private void button1_Click(object sender,EventArgs e)
{
if (textBox1.Text=="")
{
MessageBox.Show("请输入姓名","提示",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
textBox1.Focus();
return;
}
if (comboBox1.Text =="")
{MessageBox.Show ("请选择出生日期","提示",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
comboBox1.Focus();
return ;
}
if(textBox2.Text=="")
{
MessageBox.Show ("请输入E-mail地址","提示",MessageBoxButtons.OK ,MessageBoxIcon.Exclamation );
textBox2.Focus();
return;
}
if(textBox2.Text.IndexOf('@')==-1||textBox2.Text.IndexOf('@')==0||textBox2.Text.IndexOf('@')>textBox2.Text.Length -6)
{
MessageBox.Show("E-mail地址有误","提示",MessageBoxButtons.OK,MessageBoxIcon.Exclamation );
textBox2.Focus();
return;
}
MessageBox.Show(textBox1.Text +"你好,计算机网络技术班通过!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information );
this.Close();
}
}
}