Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Command button Not Enabled but still hears click?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00172199
Message ID:
00172554
Views:
18
>Hi Vern..
>
>I think the issue relates to queued-up events. Regardless of whether the CommandButton Object is enabled - clicking the mousebutton does indeed generate a windows event. By the time the CommandButton gets enabled again,the second click can be processed. Here is one example of click method code that does fix the problem:
>
>This.Enabled = .F.
>for x = 1 to 200
> If Mod(x,10) = 0
> DoEvents
> Endif
> Acti screen
> ?x
>Next x
>This.Enabled = .T.
>
>The call to DoEvents allows for queued-up click events to be processed. Because the process while the enabled property is set to .F., nothing happens. You will want to use DoEvents sparingly as it will degrade performance quite a bit.

DOEVENTS did the trick for me. Will use it sparingly.

Thank you all!

Vern
Vern
Previous
Reply
Map
View

Click here to load this message in the networking platform