private void button1_Click(object sender, System.EventArgs e)
{
if(textBox1.Text=="")
{
this.Close(); //怎样写才能彻底关闭窗体
this.dispose();
return;
}
else
{
MessageBox.Show("Can't be Closed!");
return;
}
MessageBox.Show("Why and i style here!"); //程序为什么会运行这一句。
}
{
if(textBox1.Text=="")
{
this.Close(); //怎样写才能彻底关闭窗体
this.dispose();
return;
}
else
{
MessageBox.Show("Can't be Closed!");
return;
}
MessageBox.Show("Why and i style here!"); //程序为什么会运行这一句。
}
解决方案 »
- winform里面datagridview 如何把垂直滚动条设置在左手边,方便左手的人使用
- C#递归问题
- 新手请教c#如何实现局域网校时
- WebHttpRequest 和 WebFileRequest的一点区别
- 一个初学者的细节问题??
- C#如何解析BT种子文件,得到文件大小?
- 求助,使用soctet 或 tcp实现服务端定时向客户端发信息
- 正则表达式问题
- 导出EXCEL文件的问题
- datagrid设置不同数据源的更新问题
- hashtable在大数据量(大概30万条)下的性能如何?
- SqlDataReader 继承MarshalByRefObject那么它可否序列化?书中说:SAO显式定义URL,CAO的URL非显式的?可是编程时仍旧需要亚?
private void button1_Click(object sender, System.EventArgs e)
{
if(textBox1.Text=="")
{
this.Close();
return;
}
else
{
MessageBox.Show("Can't be Closed!");
}
MessageBox.Show("Why and i style here!"); //程序为什么会运行这一句。
}
而且你textbox.text 获取什么你那里没有写啊!
所以它会运行到下面的。如果IF成立它不会往下走的1
{
this.Close();
Application.Exit();
return;
}
else
{
MessageBox.Show("Can't be Closed!");
}
MessageBox.Show("Why and i style here!");