|
-
September 25th, 2001, 05:40 PM
#1
Listbox text selection
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
-
September 25th, 2001, 07:14 PM
#2
Re: Listbox text selection
Change your declaration of SendMessage to ublic Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(byval hWnd as Long, _
byval wMsg as Long, _
byval wParam as Long, _
lParam as Any) as Long
-
September 25th, 2001, 08:15 PM
#3
Re: Listbox text selection
yeah, that's exactly what I have and still no idea why it won't work. Thanks for the help.
-
September 26th, 2001, 08:14 AM
#4
Re: Listbox text selection
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]
-
September 26th, 2001, 08:24 AM
#5
Re: Listbox text selection
the fourth parameter (the string to search for) also has to be passed ByVal...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|