Re: Keyboard '{ALT+DOWNARROW}' by Willianto
Willianto
Wed Dec 03 15:17:20 CST 2003
Hi budieko,
budieko wrote:
> The gotfocus event always (when meet conditions) drops down the
> combobox, doesn't it ?
Yes, assuming you follow Eric's suggestion to put the Keyboard statement
in the GotFocus event.
> Meanwhile some users prefer to type directly to combobox (dropdown
> combo style) then choosing from the list (because it's faster).
You meant like typing 'N' and then open the drop down list to expect the
list starts from 'N' ?
> But I'd like to drop down the list (only) when users make a mistake or
> confuse
Will the following help?
*
* QuickFill Combo
* Author: Ken Weber
* Last Modified: 5/20/1999
*
* Instruction: Please put following snippets in appropriate event:
*!* Key Press Event:
LPARAMETERS nKeyCode, nShiftAltCtrl
if between(nKeyCode, 32, 122)
for x = 1 to this.ListCount
if upper(subs(this.list(x), 1, this.selstart+ 1)) = ;
upper(subs(this.text, 1, this.selstart)+chr(nKeyCode))
nCurPos = this.selstart + 1
this.Value = this.list(x)
this.SelStart = nCurPos
* Modified by Willianto:
* Anticipate when the user press space;
* without the IF, the the code would try to fill negative
* value in SelLength.
IF (LEN(ALLTRIM(THIS.List(x))) - nCurPos) > 0
this.SelLength = len(allt(this.list(x))) - nCurPos
ELSE
THIS.SelLength = 0
ENDIF
nodefault
exit
endif
next x
ELSE
IF nKeyCode = 27
NODEFAULT
ENDIF
Endif
*!* InteractiveChange Event
IF EMPTY(THIS.Value)
KEYBOARD '{F4}'
ENDIF
hth,
Willianto