Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution
Message
From
24/10/2004 15:15:24
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
24/10/2004 14:18:44
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
00954084
Message ID:
00954121
Views:
17
Hi Tore

ON KEY LABEL are more difficult because the user could hit it more than once, it could fire even when no form is active where it will crash.

>You know how it is, I never use a button for the prupose, so I forgot about it. It's probably even the simplest solution. :-)
>
>>Put a button on the form with .Cancel = .T.
>>
>>>You have at least two options:
>>>ON KEY LABEL ESC thisform.release
>>>Or, a much better solution is to put this in the KeyPress event method
>>>if nKeyCode = 27
>>>   thisform.release
>>>endif
>>>Personally I give my customers a last chance to regret, with a timeout. This also goes into the KeyPress event method
>>>DO CASE
>>>   CASE nKeyCode = 27	&&Escape
>>>      IF MESSAGEBOX('Do you really want to exit the program?',4+16+256,'Obs!',5000)=6
>>>	 thisform.Release()
>>>      ENDIF
>>>   CASE morestuff..
>>>ENDCASE
>>>
>>>>ok, thanks I will try and let you know
>>>>by the way...i have a problem with on escape too...i want to release a form when I press ESC.have any ideea
Previous
Reply
Map
View

Click here to load this message in the networking platform