Try this.
Public Sub AutoSelect(ByVal cbo As ComboBox, _
ByVal e As System.Windows.Forms.KeyEventArgs)
'This works for comboboxes where the
'DropDownStyle = DropDown
'Place AutoSelect sub in a global module
'Add strFind to global module also, like this...
'Public strFind As String
'Use AutoSelect like this, with the KeyUp event...
'Private Sub myComboBox_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles myComboBox.KeyUp
'AutoSelect(myComboBox, e)
'End Sub
'When focus leaves the combobox
'reset strFind to "" like this...
'Private Sub myComboBox_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles myComboBox.LostFocus
' strFind = ""
'End Sub
'This is where the code for AutoSelect starts...
Dim intIndex As Integer
Dim strFound As String
'nothing to do here
'exit sub for navigation keys
If ((e.KeyCode = Keys.Left) Or _
(e.KeyCode = Keys.Right) Or _
(e.KeyCode = Keys.Up) Or _
(e.KeyCode = Keys.Down) Or _
(e.KeyCode = Keys.PageUp) Or _
(e.KeyCode = Keys.PageDown) Or _
(e.KeyCode = Keys.Home) Or _
(e.KeyCode = Keys.End)) Then
Exit Sub
End If
'if the combobox receives the focus
'via tab or enter, do nothing
If e.KeyData.ToString = "Tab" Or strFind = "Enter" Then
Exit Sub
End If
'the user entered a space
'don't attach e.KeyData to strFind
If e.KeyData.ToString = "Space" Then
strFind = strFind & " "
GoTo jumptohere
End If
'the user entered a backspace
'set strFind to the same length as
'the current text in the combo box
'don't attach e.KeyData to strFind
If e.KeyData.ToString = "Back" And Len(strFind) > 0 Then
cbo.SelectionStart = cbo.Text.Length
strFind = Mid(cbo.Text, 1, Len(cbo.Text))
Exit Sub
ElseIf e.KeyData.ToString = "Back" Then
'there is no more text in the combobox
'and the user kept hitting backspace
Exit Sub
End If
'attach e.KeyData to strFind
strFind = strFind & e.KeyData.ToString
jumptohere:
'Get the index of the first match
intIndex = cbo.FindString(strFind)
'If there is a match get the text of the first match.
If (intIndex > -1) Then
strFound = cbo.Items(intIndex).ToString()
' Select this item from the list.
cbo.SelectedIndex = intIndex
' Select the portion of the text that was automatically
' added so that additional typing will replace it.
cbo.SelectionStart = strFind.Length
cbo.SelectionLength = strFound.Length
'else, there was no match
Else
'if there isn't a match and the text typed in is only 1 character
'or nothing then just select the first entry in the combo box.
If strFind.Length = 1 Or strFind.Length = 0 Then
cbo.SelectedIndex = 0
cbo.SelectionStart = 0
cbo.SelectionLength = Len(cbo.Text)
Else
'limit the user to choices only
'available in the combobox
cbo.Text = Mid(cbo.Text, 1, Len(cbo.Text) - 1)
cbo.SelectionStart = cbo.Text.Length
strFind = Mid(cbo.Text, 1, Len(cbo.Text))
End If
End If
End Sub