.net - Custom overrides the Enabled property of the UserControl? -
i have user_control 1 textbox , button. want override enabled property of control in such way, retain button enabled , enable / disable of control affect textbox.
how can archive it? in advance.
edited : think question may not clear. have overrides enabled property follows,
private m_enabled boolean public overloads property enabled() boolean return m_enabled end set(byval value boolean) button1.enabled = true textbox1.enabled = value m_enabled = value end set end property
i have place usercontrol , few other textboxs in panel1. try loop through controls 1 one , disable it.
each panelcontrol control in panel1.controls panelcontrol.enabled = false next panelcontrol
this enabled property never called in case. (whole control disabled / enabled)
can me?
the problem cast: for each panelcontrol control
use control's enabled property, not overload.
try casting instead:
for each ctrl usercontrol1 in panel2.controls.oftype(of usercontrol1)() ctrl.enabled = false next
Comments
Post a Comment