> Is there a way to disable an event handler, like a clik on a button
at a certain stage of the program.
there are several possibilities here.
you could for example add a boolean control variable to your class and
inside the event handler test the variable:
void bt_Click(...)
{
if ( controlVariable )
{
// handle the event
}
}
you could also just remove the delegate from the event:
bt.Click -= new EventHandler( eventHandler );
and add it again when necessary:
bt.Click += new EventHandler( eventHandler );
regards,
Wiktor Zychla