Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to detect a click when timer is running
Message
From
25/10/2005 16:33:39
 
 
To
25/10/2005 16:00:16
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:
01062038
Views:
8
>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

I have used code similar to this.
*  Pause for key and mouse strokes
IF VERSION(5)<>700
	DOEVENTS
ENDIF

LOCAL lnKey, oCTRL
* if mouse clicked...
lnKey = INKEY(0.001,"MH")
IF lnKey=151

	oCTRL = SYS(1270)		&& Get object under mouse.
	DO CASE
		CASE TYPE("oCTRL")<>"O" OR ISNULL(oCTRL)
			* no object - ignore
		CASE LOWER(oCTRL.NAME)=="cmdstop"
			*  Stop button clicked during run
			oCTRL.CLICK()
	ENDCASE
ENDIF
It does require the it is in a processing loop. (DO WHILE...)
Greg Reichert
Previous
Reply
Map
View

Click here to load this message in the networking platform