Author : C
Date Submitted : 4/25/2005
Category : Database
Compatibility : VB 6
This code has been accessed 9313 times.
Task : ever wanted to search a listbox while typing in a textbox? kinda like Microsoft help style?
Declarations
Code
'''''''''''''''''''''''''''''
'email me for any comment '
'northern_sword@hotmail.com '
'''''''''''''''''''''''''''''
option Explicit
private Declare Function SendMessage Lib "User32" _
Alias "SendMessageA" (byval _
hWnd as Long, _
byval wMsg as Integer, _
byval wParam as string, _
lParam as Any) as Long
Const LB_FINDSTRING = &H18F
private Sub Form_Load()
With List1
.Clear
.AddItem "RAM"
.AddItem "rams"
.AddItem "RAMBO"
.AddItem "ROM"
.AddItem "Roma"
.AddItem "Rome"
.AddItem "Rommel"
.AddItem "Cache"
.AddItem "Cash"
End With
End Sub
private Sub Text1_Change()
List1.ListIndex = SendMessage(List1.hWnd, LB_FINDSTRING, _
Text1, byval Text1.Text)
End Sub