We help IT Professionals succeed at work.

Command1.Enabled = False ??

Erick37
Erick37 asked
on
Medium Priority
477 Views
Last Modified: 2006-11-17
I have a form with only one Command Button.  When the user clicks the button, I execute a sub which sets Command1.Enabled = False.  Before the sub returns, I re-enable the Command1 button.
Problem:
If the user clicks the button while it is disabled, the sub will execute again upon return.  Why is this? I thought disabling a control prevented the click event from entering the event queue.  Any suggestions?
Comment
Watch Question

Commented:
Have you tried putting a DoEvents in your code before you re-enable the button.  Incase it is queuing things until it gets a chance to process them?

Cardo......
Top Expert 2005

Author

Commented:
Thanks Cardo, that was the problem.  Submit it as an answer for the points.
Regards, Eric
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.