by Karnam Bhanu Prakash (4 Submissions)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 28th March 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
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
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
No comments have been posted about Searching ListBox for typed Characters in TextBox and selecting if match found. Why not be the first to post a comment about Searching ListBox for typed Characters in TextBox and selecting if match found.