Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trapping for F8 in a textbox
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00980789
Message ID:
00980964
Views:
54
In the textbox gotfocus you could
ONKEY LABEL F8 MESSAGEBOX([F8 KEY PRESSED])
this.value won't work with on key, so a method would have to be DOed!
It could then be cleared in lostfocus.

>Hello Foxperts,
>
>I'm trying to capture the F8 keystroke and use it to replace the contents of a character field with another string that was saved in a memvar. Here's the code I've placed in the KeyPress event-method of the textbox:
>
LPARAMETERS nKeyCode, nShiftAltCtrl
>	WAIT "You Pressed "+TRANSFORM(nKeyCode) WINDOW NOWAIT   && for debug only
>IF nKeyCode=-7
>	NODEFAULT
>	oRec_mem.bwk_PlaceName=m.PlaceName
>	This.Refresh()
>ELSE
>	DODEFAULT(nKeyCode)
>ENDIF
>The WAIT ... WINDOW line shows me the nKeyCode for F7 and F9, but F8 returns nothing.
>
>UPDATE: F8 appeared to return nothing because an old ON KEY LABEL F8 DO ... was lurking in the dBASE/DOS program I've been trying to replicate in VFP. Thanks........ posting the problem solved it again!
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform