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 ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.