Listbox / Multiselect / Alphabetical select
When I Press any key on my keyboard...I want to have the item highlighted which is as near as possible...
"A" should result in the first item which start with A...after "A" I press...."B" and I get some item which starts with AB selected...
I found some code which works fine when you have a normal listbox..when I use a MultiSelect box it doesn't work anymore...with a normal box it works perfect
VB Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long
Const LB_FINDSTRING = &H18F
Private Sub Text1_Change()
'Retrieve the item's listindex
List1.ListIndex = SendMessage(List1.hwnd, LB_FINDSTRING, -1, ByVal CStr(Text1.Text))
End Sub