Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro substitution
Message
De
24/10/2004 15:15:24
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
24/10/2004 14:18:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
00954084
Message ID:
00954121
Vues:
18
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform