C#中如何设置模式窗体,就是关闭子窗体才能操作母窗体

不知道叫模式还是非模式窗体
就是要 关闭子窗体才能操作母窗体
this.Modal,MdiParent什么属性来着
Form1为母窗体, Form2为子窗体,关闭2才能操作1

在实例的时候用showdialog()就好了

譬如在
form2 f2=new form2();
f2.showdialog();
这样在form2关闭前,就不允许用主窗口
温馨提示:内容为网友见解,仅供参考
第1个回答  2009-11-24
打开子窗口的时候隐藏FORM1
第2个回答  2009-11-24
那你让它弹出的方式为对话框就好了,showdialog()
第3个回答  2009-11-24
Form2 form2=new Form();

form2.showdialog();
第4个回答  2009-11-24
Form2 frm = new Form2();
frm.ShowDialog();

参考资料:如果您的回答是从其他地方引用,请表明出处

相似回答