如何在form2的按钮单击事件上禁用form1,该事件作为对话框加载在form1之上 [英] how to disable form1 on a button click event of form2 which loads as a dialog box on top of form1
本文介绍了如何在form2的按钮单击事件上禁用form1,该事件作为对话框加载在form1之上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是c#windows表单中的新手,我有2个表单,表单1和表单2. Form2从form1和form2加载为对话框2个按钮OK和CANCEL。单击取消按钮我希望窗体2中的控件被禁用。请帮帮我。
提前致谢。
解决方案
< blockquote>
@我想让form2中的控件被禁用。请帮帮我。
只需将所有个人控件放入Panel,然后直接设置Panel.Enabled = False。
Hi,
I am a newbie in c# windows forms and I have 2 forms here form 1 and form 2. Form2 loads as a dialog box from form1 and form2 has 2 buttons OK and CANCEL. on clicking cancel button I want the controls in the form2 to get disabled. Please help me out.
Thanks in advance.
解决方案
@I want the controls in the form2 to get disabled. Please help me out.
Just put all of ur controls into a Panel, and directly set Panel.Enabled=False.
这篇关于如何在form2的按钮单击事件上禁用form1,该事件作为对话框加载在form1之上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文