Re: How to prevent multiple button click?
Ok. I got the point now. The default behavior of windows is that it queues up events as messages. Now when you click a button, in the event handler we first make the button disabled and then start some process, the UI is locked. In the mean time, you try to click the disabled button, this click gets queued up and when the button is enabled and the UI is unlocked, the event gets first and it again triggers the click event. Why only Button, you can try it with any control on the form. Actually using same code, you will see that when you run the code and click the button and then immediately click the minimize button on the form and you will see once the event handler completed, the form would be minimized.
The way I would do is disable the button, start a process on the another thread and once that work is complete enable the button in the "RunWorkerCompleted " event handler of the background worker.