FormSendQueue formSendQueue = new FormSendQueue(); private void button1_Click(object sender, EventArgs e) { formSendQueue.ShowDialog(); }
把窗体创建语句放到外面
if (!formSendQueue.IsDisposed) { MessageBox.Show("formsendqueue窗体打开"); } else { MessageBox.Show("formsendqueue窗体已经关闭"); }