I don't want to allow user to double click on my button. On the first click it should be disabled and once my code is executed, i should enable the button. How to do ?
You can use the Enabled property. Register an OnClick event handler and set Enabled to false as the first thing. Then start you computation and restore Enabled to true, when you are finished. If the computation takes long to complete, you should start a second thread. In that case, you may need to use Invoke method to re-enable the button.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With