Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Enter Key not registering as a KeyPress Event in ListBox
Message
From
01/05/2002 14:43:04
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Enter Key not registering as a KeyPress Event in ListBox
Miscellaneous
Thread ID:
00651484
Message ID:
00651484
Views:
81
Hi there,

I am working on an application written in VFP 5.0, and am having the following issue:

I have the code below in the ParentForm.KeyPress procedure, yet when focus is on the list box ("LSTCOMP") and I hit the ENTER key, my application doesn't run code in the KeyPress procedure.

******************************************

LPARAMETERS nKeyCode, nShiftAltCtrl
local lcObject

if type('thisform.activecontrol')<>'U'
lcObject = THISFORM.ACTIVECONTROL.NAME

Do case

case upper(lcObject) = 'TXTITEM'
** if the user hits the enter key, move focus to next object
if nKeyCode = 13
keyboard '(TAB)'
endif

case upper(lcObject) = 'LSTCOMP'

do case
** if user hits Enter, "click the OK button"
case nKeyCode = 13
thisform.cmdOk.click()
nodefault
RETURN .F.
endcase

endcase
endif
******************************************

Why isn't the ENTER key seen as a keypress while focus is on the listbox?

Thanks for listening and for any ideas you might have,

Joe
Next
Reply
Map
View

Click here to load this message in the networking platform