Article ID: 119738
Article Last Modified on 1/8/2003
SendMessage (hWnd%,LB_FINDSTRING, wParam%, lparam)where
hWnd% is the hWnd of the list box.
wParam% is an integer that specifies the starting point for the
search. Use -1 to search the whole list box.
lParam is a long pointer to the string to find.
' Enter the Declare statement on one single line:
Declare Function SendMessage Lib "user" (ByVal hwnd As Integer,
ByVal wMsg As Integer, ByVal wp As Integer, lp As Any) As Long
Const WM_USER = &H400
Const LB_FINDSTRING = (WM_USER + 16)
Sub Form_Load()
List1.Clear
List1.AddItem "Apples"
List1.AddItem "Banana"
List1.AddItem "Bread"
List1.AddItem "Break"
End Sub
Sub Text1_Change()
' The following code should be on one single line:
List1.ListIndex = SendMessage(List1.hWnd, LB_FINDSTRING, -1, ByVal
Cstr(Text1.Text))
End Sub
Additional query words: 3.00
Keywords: KB119738