Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removeobject skips some objects
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00835738
Message ID:
00835836
Views:
9
Joe,

If I have over anxious users or long running code I always do this in the button Click event:

this.Enabled = .f.
* do the long running thing
this.Enabled = .t.

If you use a timer to reenable the button then they can still endup relaunching the process several times.

You can use one timer set to an interval of say 10 seconds, and a tLastClicked property on the button. When the button is clicked set .tLastClicked = datetime() and then in the timer do something like this:
for each loControl in this.parent.objects
   if ( ! loControl.Enabled )
      loControl.Enabled = datetime() > ( loControl.tLastClicked + 90 )
   endif
endfor
you might want to do some PEMStatus() checks etc but this gives you the basic idea.

>Because vapps may have changed which will add and/or remove buttons. The buttons are disabled as soon as the user clicks them. This is because some of the apps they launch have a lag time of maybe 60 seconds or so before they appear. We found that if we don't disable the button, the users click repeatedly (starting the app maybe 20 times) before they see the app start. The timer re-enables the button after a pause of about 90 seconds. So as far as I can tell, I need a timer for each button.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform