Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am performing a particular operation when a click event is fired.
If a user continuously clicks that button control as soon as the existing event finishes the new event gets called. Hence my operation fails.

I tried keeping a flag to do this but as soon the flag gets activated the new instance gets activated.

Is there any way to solve this.
Posted
Comments
VC.J 13-Oct-14 7:20am    
you should show some message or dialogue box and close that box when your event completes its execution or disable the button
KUMAR619 13-Oct-14 7:28am    
Yes you are right. How to hide that message box because while running it should occur as a hidden background message
VC.J 13-Oct-14 7:35am    
Solution suggested by Cpallini below is better choice what you can do when you click the button disable the button and at the last line of the event enable it.

1 solution

You could disable the button at the very beginning of the event handler and enable it again when the operation is completed.
 
Share this answer
 
Comments
BillWoodruff 13-Oct-14 7:25am    
+5 Bullseye !
Sergey Alexandrovich Kryukov 13-Oct-14 10:48am    
Simple, isn't it? A 5.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900