Is there any way to temporarily disable ALL events on an windows form?
I have situation where processing on a secondary thread is being corrupted by events on the
This is a standard threading problem. Even if you could block the events, very hard to do, it still won't solve the problem. Because the event handler might already have started, but not yet finished, by the time you want to start blocking.
And it has a standard solution, use the lock keyword.
If that is not practical because the user needs to change several controls before you can run a query again then you need to terminate the running thread first. BackgroundWorker.CancelAsync for example. If that's not practical because it takes too long to cancel the query then you need to set the controls Enabled property to false while the query is running.