ComboBox 模糊搜索问题
如何设计ComboBox的过滤功能,直接能模糊查找如何设计的过滤功能,直接能模糊查找
详细说就是直接在omboBox输入字符后,下拉框显示出来过滤后的结果
输入的字符可能是后面的几位,不是从头开始的
Option Explicit Dim dataList(5) As String Sub ini() dataList(0) = "apologize" dataList(1) = "abuse" dataList(2) = "access" dataList(3) = "amusement" dataList(4) = "moment" dataList(5) = "movement" End Sub Sub setData() Dim i As Integer For i = 0 To 5 List1.List(i) = dataList(i) Next End Sub Private Sub Form_Load() ini setData Text1.Text = "" End Sub Private Sub List1_Click() Text1.Text = List1.Text End Sub Private Sub Text1_Change() List1.Clear Dim i As Integer For i = 0 To 5 If InStr(1, dataList(i), Text1.Text) <> 0 Then List1.AddItem dataList(i) Next End Sub