Private Sub Combo1_KeyPress(KeyAscii As Integer)
Dim bExist As Boolean
If KeyAscii = 13 Then
For i = 0 To Combo1.ListCount
If Combo1.Text = Combo1.List(i) Then
Label1.Caption = "输入项已存在组合框中"
bExist = True
Exit For
End If
Next i
If bExist = False Then
Combo1.AddItem Combo1.Text
Label1.Caption = "已添加输入项"
End If
End If
End Su