Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
KeyPress bug?
Message
From
04/04/2002 10:09:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
04/04/2002 10:00:23
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00640867
Message ID:
00640874
Views:
14
Works as expected (wait window appears on F2)
Cetin
>In VFP7, the F2 key doesn't trigger the KeyPress event. This used to work correctly under VFP6 but in VFP7 the key is ignored. I suspect it has to do with the new key assignements in VFP7 where the F2 key is used to move to the next bookmark and to rename a file in the project manager. I would appreciate if someone could confirm this behaviour. To reproduce the problem, simply run the code below. Pressing the F2 key triggers the WAIT WINDOW in VFP6, but the key is ignored in VFP7.
>
>Thanks for any feedback.
>
>
>o = CREATEOBJECT("TestForm")
>o.show()
>
>DEFINE CLASS TestForm AS FORM
>
>   caption = "Press any key..."
>   height = 70
>   width = 290
>   autocenter = .T.
>   WindowType = 1
>   KeyPreview = .T.
>
>   ADD OBJECT cmdCancel AS cmdCancel
>
>   PROCEDURE Init
>      PUSH KEY CLEAR
>   ENDPROC
>
>   PROCEDURE Destroy
>      POP KEY
>   ENDPROC
>
>   PROCEDURE KeyPress(nKeyCode, nShiftAltCtrl)
>
>      WAIT WINDOW TIMEOUT 1 "Form.KeyPress()" + CHR(13)+;
>                            "nKeyCode = " + ALLTRIM(STR(nKeyCode)) + CHR(13) + ;
>                            "nShiftAltCtrl = " + ALLTRIM(STR(nShiftAltCtrl))
>
>   ENDPROC
>
>ENDDEFINE
>
>DEFINE CLASS cmdCancel as COMMANDBUTTON
>   autosize = .T.
>   caption = "Cancel"
>   cancel = .T.
>   height = 27
>   left = 220
>   top = 40
>   width = 58
>   PROCEDURE click
>      thisform.release
>   ENDPROC
>ENDDEFINE
>
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform