Private Sub Form_Load()
Combo1.AddItem "ok", 0
Combo1.AddItem "no", 1
Combo1.AddItem "yes", 2
End Sub
Private Sub Combo1_LostFocus()
If isExist(Combo1.Text) = True Then
MsgBox "有"
Else
MsgBox "没有"
End If
End Sub
Private Function isExist(str1 As String) As Boolean
Dim i As Integer
For i = 0 To Combo1.ListCount - 1
If str1 = Combo1.List(i) Then
isExist = True
Exit Function
End If
Next i
isExist = False
End Function