Disable All Events on a Windows Form

后端 未结 5 851
忘了有多久
忘了有多久 2021-01-19 15:21

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

5条回答
  •  没有蜡笔的小新
    2021-01-19 16:26

    Thanks all for your excellent assistance. Really helped the decision making process. Upvotes to everyone. Ended up using a lock. (I.e. an if statement at the start of each event handler checks the lock status before continuing.) Tedious and not all that "cool" technically, but simple and it worked.

提交回复
热议问题