Add ValueChanged event handler AFTER control is initialized

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to add a ValueChanged event handler to a control. If I add the handler
during form construction then the ValueChanged handler gets called when the
control is initialized, and I don't want this. However I cannot find a place
during form initialization where I can add the handler AFTER the control has
been initialized.

So, how do I add a ValueChanged event handler to a control AFTER the control
has been initialized?

- Javaman
 
Hi,

You can do so after InitializateComponents() is called in the constructor.

Additionally you could do so in the Load event of the form.

cheers,
 
Thanks Ignacio,

In testing your solutions I've discovered that the root of my problem was a
programming error on my part. In fact ValueChanged is not normally called for
a control when the form and control are initialized.

Cheers,

Stephen
 
Back
Top