* 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 ENDIFIt does require the it is in a processing loop. (DO WHILE...)