- Code: Select all Expand view
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
LOCAL oLbx
LOCAL cVar := ""
DEFINE DIALOG oDlg
@ 1, 1 LISTBOX oLbx VAR cVar ITEMS { "Bert", "Carl", "William" }
oLbx:bKeyDown = { | nKey | MsgInfo( nKey ) }
@ 3, 1 BUTTON "&Close" ACTION oDlg:End()
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
A possible solution is to add the following method to TListBox class:
- Code: Select all Expand view
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TListBox
if nMsg == WM_GETDLGCODE .and. nWParam == VK_RETURN
::oWnd:nLastKey := VK_RETURN
return Super:KeyDown( nWParam, nLParam )
endif
return Super:HandleEvent( nMsg, nWParam, nLParam )
EMG