*** handle the key...IOW, find the closest match in the list IF This.SelStart > 0 IF ( LASTKEY() > 31 AND LASTKEY() < 128 ) OR ( LASTKEY() = 7 ) This.Parent.Search() ENDIF ENDIFThis code in the container's Search method:
LOCAL lcSofar, lnSelStart, lnSelLength, lnRow WITH This WITH .txtqFill *** Handle backspace key IF LASTKEY() = 127 .SelStart = .SelStart - 1 ENDIF *** Get the value typed in so far lnSelStart = .SelStart lcSofar = LEFT( .Value, lnSelStart ) *** Find a match in column #1 of the list portion of this control ENDWITH WITH .lstSearch *** Reset the list index in case we have type ion something that is not *** in the list .ListIndex = 0 FOR lnRow = 1 TO .ListCount IF UPPER( .List[ lnRow, 1 ] ) = UPPER( lcSoFar ) .ListIndex = lnRow *** Synchronize the contents of the textbox with what is selected *** in the list This.txtQfill.Value = .Value EXIT ENDIF ENDFOR ENDWITH WITH .txtqFill *** Highlight the portion of the value after the insertion point .SelStart = lnSelStart lnSelLength = LEN( ALLTRIM( .Value ) ) - lnSelStart IF lnSelLength > 0 .SelLength = lnSelLength ENDIF ENDWITH ENDWITH