sub text1_change() on error resume next combobox1.text = text1.text end sub
设计时将combo1.style = 2 Private Sub Form_Load() With Combo1 .AddItem "" For i = 0 To 9 .AddItem String(6, Asc("a") + i) Next End With End SubPrivate Sub Text1_Change() Combo1.ListIndex = 0 For i = 0 To Combo1.ListCount - 1 If Text1.Text = Combo1.List(i) Then Combo1.Text = Combo1.List(i) Exit For End If Next End Sub
on error resume next
combobox1.text = text1.text
end sub
Private Sub Form_Load()
With Combo1
.AddItem ""
For i = 0 To 9
.AddItem String(6, Asc("a") + i)
Next
End With
End SubPrivate Sub Text1_Change()
Combo1.ListIndex = 0
For i = 0 To Combo1.ListCount - 1
If Text1.Text = Combo1.List(i) Then
Combo1.Text = Combo1.List(i)
Exit For
End If
Next
End Sub