Hello,
I need to highlight text in the listbox based on what was typed in the combobox, but the
List1.ListIndex = SendMessage(List1.hwnd, LB_SELECTSTRING, -1, Combo1.Text)
Doesn't work for some reason. What am I doing wrong? Thank You
Printable View
Hello,
I need to highlight text in the listbox based on what was typed in the combobox, but the
List1.ListIndex = SendMessage(List1.hwnd, LB_SELECTSTRING, -1, Combo1.Text)
Doesn't work for some reason. What am I doing wrong? Thank You
Change your declaration of SendMessage to:public Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(byval hWnd as Long, _
byval wMsg as Long, _
byval wParam as Long, _
lParam as Any) as Long
yeah, that's exactly what I have and still no idea why it won't work. Thanks for the help.
I tried your code. It works if you change the line to the following
List1.ListIndex = SendMessage(List1.hWnd, LB_SELECTSTRING, -1, ByVal CStr(Combo1.Text))
Iouri Boutchkine
[email protected]
the fourth parameter (the string to search for) also has to be passed ByVal...