Searching ListBox for typed Characters in TextBox and selecting if match found
Searching ListBox for typed Characters in TextBox and selecting if match found
API Declarations
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const LB_FINDSTRING = &H18F
Rate Searching ListBox for typed Characters in TextBox and selecting if match found
(1(1 Vote))
Private Sub Form_Load()
List1.Clear
List1.AddItem "India"
List1.AddItem "Italy"
List1.AddItem "USA"
List1.AddItem "UK"
List1.AddItem "Iraq"
List1.AddItem "London"
List1.AddItem "Paris"
List1.AddItem "New Delhi"
End Sub
Private Sub Text1_Change()
List1.ListIndex = SendMessage(List1.hwnd, LB_FINDSTRING, ByVal &O0, ByVal CStr(Text1.Text))
End Sub
Searching ListBox for typed Characters in TextBox and selecting if match found Comments
No comments yet — be the first to post one!
Post a Comment