winfrom 判断窗体是否打开

代码如下:http://blog.csdn.net/zdb330906531/article/details/38663521

		Form1 form = null;
		private void button1_Click(object sender, EventArgs e)
		{
			if (form == null || form.IsDisposed)
			{
				form = new Form1();
				form.ShowDialog();
			}
			else 
			{
				form.Visible = false;
				form.ShowDialog();
			}
		}



你可能感兴趣的:(C#)