RowSource type 5 - Array
Style 0 – Dropdown combo
Its RowSource is set to an array aCredOptions
When the user clicks on the Down arrow and then clicks on one of the 5 rows of the dropdown (say, “S”), that works fine. The form shows the value “S” in the listbox and the corresponding description is also displayed.
If the user enters one of the five values into the control, that also works.
What is the best way of ensuring that the character entered into the listbox (if the user is working that way, rather than using the down-arrow) is valid? Is it a matter of putting code onto the KeyPress() event? At present I have this code :
* cboCredit.Keypress() LPARAMETERS nKeyCode, nShiftAltCtrl LOCAL lChar lCHAR = UPPER(CHR(nKeyCode)) IF !(lChar $ " BCLS") .AND. nKeycode > 48 NODEFAULT RETURN ENDIF RETURN DODEFAULT(nKeyCode, nShiftAltCtrl)
Would welcome guidance - maybe I should be using a different control class . . . .
Thanks for your help.