增加一个拼音列作为辅助,然后参考:
http://www.foxtable.com/webhelp/scr/2466.htm
TextChanged事件代码改改:
Dim drp As WinForm.DropDownBox = e.sender
If drp.DroppedDown Then '如果下拉窗口已经打开
Dim tbl As Table = Tables("窗口1_Table1")
If drp.Text = "" Then '如果内容为空
tbl.Filter = "" '显示所有客户
Else '否则根据输入内容进行模糊筛选
Dim txt As String = "'%" & drp.Text & "%'"
tbl.Filter = "客户ID Like " & txt & " Or 公司名称 Like " & txt & " Or 地址 Like " & txt & " Or 联系人 Like " & txt & " or 联系人拼音列 like '" & GetPinYIN(drp.Text ,1).substring(0,1) & "%'"
End If
End If