Typing into a combo box

Rich
10-31-2001, 12:44 PM
Hey all,

I'd like to type into a combo box and have the contents of the Combo box appear in the text area as I type letters. Kind of like the way that the index of MSDN finds the items in the listbox by the letters typed into the textbox above...

Any ideas?

Thanks in advance,

Rich

Flyguy
10-31-2001, 12:50 PM
Perform a "search" on the forum first, there is already a fresh thread discussing this.

Rich
10-31-2001, 01:02 PM
Do you happen to have a keyword for the search, because I've been searching before and since my question was posted...

Thanks

Rich

Laurent
10-31-2001, 01:08 PM
isn't this used by default in the combobox? as soon as you type something, it shows the first corresponding item in the list...

on the other hand it doesn't select the given item when it loses focus, to do so you can try something like this
Private Sub cmbListeClient_LostFocus()
If Trim(cmbListeClient.Text) <> "" Then
Dim i As Integer
For i = 0 To cmbListeClient.ListCount
If UCase(Left(cmbListeClient.List(i), Len(cmbListeClient.Text))) = UCase(cmbListeClient.Text) Then
cmbListeClient.ListIndex = i
Exit For
End If
Next i
End If
End Sub

this example is the one i use for the combobox where i have a list of client

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum