c# how to disable a event

85

c# how to disable a event -

bool dontRunHandler;

void Handler(object sender, EventArgs e) {
   if (dontRunHandler) return;

   // handler body...
}

c# how to disable a event -

object.Event -= new EventHandlerType(your_Method);
// Change your cell value
object.Event += new EventHandlerType(your_Method);

Comments

Submit
0 Comments