[RESOLVED] Search on Combobox,
i have one text box, a combox and a command button,
Quote:
Option Explicit
Private Const CB_FINDSTRING = &H14C
Private Const LB_FINDSTRING = &H18F
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 Sub Command1_Click()
FindCB Combo1, Text1.Text
End Sub
Private Sub Form_Load()
Combo1.AddItem "MB489LE/"
Combo1.AddItem "MB489XE"
Combo1.AddItem "MB489FD"
Combo1.AddItem "MC2341"
Combo1.AddItem "XDMD42"
Combo1.AddItem "XDMD41"
Combo1.AddItem "KCLSISD"
End Sub
Private Sub FindCB(obj As Object, TextToFind As String)
obj.ListIndex = SendMessage( _
obj.hwnd, CB_FINDSTRING, -1, ByVal _
TextToFind)
End Sub
now the scenario is if i search on MB489 the output will only show the MB489FD which is i think because the Letter comes after the 9 is the F which is base on abcdefg comes first than the other lists on the combo item (am not sure with that) then the search will stop on it...
i just want to happen that for example i search MB489 all the files on the combo with that name will be shown, i mean if i press Search button, the first file MB489FD will shown up, then if i press again the search button, the MB489LE will again comes up, and so on...
with code the code above it stop on the first search
can you please edit the code and add that thing? if its possible?
TIA