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 15:09:12
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00651484
Message ID:
00651504
Views:
17
Nick,

That was the culprit!!! Thanks so much ---

Joe


>>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
>
>Is your form.KeyPreview = .t. ?
Previous
Reply
Map
View

Click here to load this message in the networking platform