Handling events from User Control

  • Thread starter Thread starter Roger
  • Start date Start date
R

Roger

Hi:

I have a user control that contains a checkbox. I load this user control n
times in panel. I also have a button on parent form that is disabled on
form load. How do I enable button when enduser clicks checkbox?

tx
Roger
 
Roger,

You will need to expose an event from your user control to indicate that
the checkbox was checked. If you expose the checkbox as a public
field/property, then you can subscribe to the checked event yourself on the
form. Every time you create the control, subscribe to that event and
enable/disable the button appropriately.

Hope this helps.
 
Back
Top