Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lastkey does not work
Message
 
 
À
13/05/2005 20:34:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01014130
Message ID:
01014132
Vues:
21
Tariq,

First, you don't need LASTKEY(). The value of the key is passed as nKeyCode parameter into the KeyPress event.
Second, there's no reason to compare logical properties to the logical constants. It's only makes code harder to read.
Third, you should use DO CASE...ENDCASE for multiple choises.
DO CASE
CASE nKeyCode = 27 AND thisform.pageframe1.visible
  thisform.pageframe1.visible = .F.
CASE nKeyCode = 27 AND NOT thisform.pageframe1.visible
  Thisform.Release()
ENDCASE
>
>On form1 I have pagefrmae1. On keypress event of Form1 I have following codes
>
>If lastkey()=27 and thisform.pageframe1.visible=.t. && first condition
>thisform.pageframe1.visible=.f.
>endif
>
>If lastkey()=27 and thisform.pageframe1.visible=.f. && second condition
>release thisform
>endif
>
>
>In first condition, if I press ESC while thisform.pageframe1.visible=.t.
>then form releases instead of thisform.pageframe1.visible=.f.
>
>I want when I press ESC key it check the visibility of pageframe1.
>If pageframe1 is visible then pageframe1 must be visible=.f.
>Otherwise Form1 should release.
>
>Please help
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform