打开Popup窗口时如何淡化父窗体的控件 [英] how to faded parent form's controls when open Popup window

查看:58
本文介绍了打开Popup窗口时如何淡化父窗体的控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了ac#window应用程序,现在我想在打开弹出窗口时更改父窗体控件的颜色。



请帮忙...... ....



提前感谢

i have developed a c# window application and now i want to change color of parent form controls when open popup window.

please help..........

thanks in advance

推荐答案

通过Form.Controls集合迭代(你' ll可能必须递归地覆盖容器控件)并将Enabled属性设置为false,或者更改ForeColor和BackColor属性。当弹出窗口关闭时,你需要将它们设置回来。



这可能不适用于所有控件 - 特别是如果其中任何一个是UserControls,它们不会暴露他们的内部运作。对于那些,您必须为每个控件添加功能。
Iterate through the Form.Controls collection (you'll probably have to do it recursively to cover container controls) and either set the Enabled property to false, or change the ForeColor and BackColor properties. You'll need to set them back when your popup closes.

This may not work for all controls - particularly if any of them are UserControls which don't expose their inner workings. For those, you will have to add the functionality to each control.


这篇关于打开Popup窗口时如何淡化父窗体的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆