Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to detect a click when timer is running
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01062025
Message ID:
01062035
Views:
11
>Hi,
>
>While a form's timer is running a long process, is it possible to click on a checkbox in order to tell the timer to stop, or any workaround to produce an event and to be able to stop it ?
>
>I have been trying different things with doevents and autoyield property but the form does not respond to 'Clicks'
>
>Thanks
>Juan C. Jaramillo

Put DOEVENTS amoung the long process.
procedure mycheckbox.Click
   thisform.mytimer.Enabled = this.Value
endproc 

Procedure mytimer.Timer
   * long processing code
   DOEVENTS FORCE && this wouldn't be executed until the previous command is complete
   * other code
Endproc
HTH
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Previous
Reply
Map
View

Click here to load this message in the networking platform