API 函数--combobox---listbox

API 函数: Private Declare Function SendMessagebyString Lib _ "user32" Alias "SendMessageA" (ByVal hWND As Long, _ ByVal wMsg As Long, ByVal wParam As Long, _ ByVal lParam As String) As Long Private Const LB_FINDSTRINGEXACT = &H1A2 '在 ListBox 中精确查找 Private Const CB_FINDSTRINGEXACT = &H158 '在 ComboBox 中精确查找 Private Const LB_FINDSTRING = &H18F '在 ListBox 中模糊查找 Private Const CB_FINDSTRING = &H14C '在 ComboBox 中模糊查找 调用方法: n = SendMessagebyString(List1.hWnd, LB_FINDSTRING, -1, SearchText) If n = -1 Then Msgbox "Not Found!" Else MsgBox List1.List(n) End If
posted @ 2008-10-22 17:14  willen  阅读(462)  评论(0编辑  收藏  举报