prova questo:
codice:
Private Sub Form_Load()
oComboBox.AddItem "marcello"
oComboBox.AddItem "franco"
oComboBox.AddItem "giuseppe"
oComboBox.AddItem "ghini76"
End Sub
Public Sub ComboBoxAutoCompleteTyping(oComboBox As ComboBox)
Dim SelStart As Integer
Dim t As Integer
SelStart = oComboBox.SelStart
t = 0
While Left(UCase(oComboBox.List(t)), oComboBox.SelStart) _
<> UCase(oComboBox.Text) And t < oComboBox.ListCount
t = t + 1
Wend
If t < oComboBox.ListCount Then
oComboBox.Text = oComboBox.List(t)
oComboBox.SelStart = SelStart
oComboBox.SelLength = Len(oComboBox.List(t)) - SelStart
End If
End Sub
Private Sub oComboBox_Change()
Call ComboBoxAutoCompleteTyping(oComboBox)
End Sub
Private Sub oComboBox_Click()
MsgBox (oComboBox.Text)
End Sub
Private Sub oComboBox_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
oComboBox_Click
End If
End Sub