如何实现组合框的文体框中输入字符,在下拉框中模糊定位选择数据项?
在组合框中的到焦点时自动打开下拉框,在组合文本框中输入字符时,能在下拉框中自动模糊定位并选择数据?如何实现?
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
ADD OBJECT combo1 AS combobox WITH ;
Height = 24, ;
Left = 36, ;
TabIndex = 2, ;
Top = 36, ;
Width = 100, ;
Name = "Combo1"
ADD OBJECT text1 AS textbox WITH ;
Height = 20, ;
Left = 36, ;
TabIndex = 1, ;
Top = 12, ;
Width = 100, ;
Name = "Text1"
ADD OBJECT text2 AS textbox WITH ;
Height = 20, ;
Left = 36, ;
TabIndex = 3, ;
Top = 84, ;
Width = 100, ;
Name = "Text2"
PROCEDURE Init
CREATE CURSOR tt (xm c(10))
INSERT INTO tt VALUES ("语文")
INSERT INTO tt VALUES ("语文1")
INSERT INTO tt VALUES ("语文2")
INSERT INTO tt VALUES ("数学")
INSERT INTO tt VALUES ("数学1")
INSERT INTO tt VALUES ("数学2")
ENDPROC
PROCEDURE combo1.InteractiveChange
cValue=ALLTRIM(This.Text)
SELECT xm FROM tt WHERE cValue$xm INTO CURSOR cx
WITH
.Rowsource="cx"
.RowsourceType=2
.Requery
ENDWITH
**KEYBOARD "{F4}" && 自动弹开下拉框,使用不方便
ENDPROC
ENDDEFINE