动态启用/禁用用户控件内的控件 [英] Enable/ Disable control inside a user control dynamically
本文介绍了动态启用/禁用用户控件内的控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我要动态地启用或禁用用户控件中的控件取决于我的页面....
我有一个用户控件,
里面有一个文本框.
我想启用此文本框,具体取决于正在使用此控件的页面...
请帮帮我....
紧急.....
在此先感谢.....
Hello,
I Want to enable or disable a control inside a user control dynamically depends on my page....
I have a user control,
inside that i have a textbox.
I want to enable this textbox to be enabled depending upon my Page that is using this control...
Please help me....
urgent.....
Thanks in advance.....
推荐答案
将文本框控件公开为usercontrol的公共属性(使用get-set).一旦可用,便可以通过用户控件实例进行访问并设置其可见性.
Expose that textbox control as a public property of the usercontrol (using get-set). Once it is available, whenever you want, access it through the usercontrol instance and set it''s visibility.
这篇关于动态启用/禁用用户控件内的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文