How do i prevent duplicated in combobox ?
Private Sub ComboBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress
If Asc(e.KeyChar) = Keys.Enter Then
AxWebBrowser1.Navigate(ComboBox1.Text)
Dim bFound As Boolean
bFound = False
For i As Integer = 0 To
ComboBox1.Items.Count - 1
If ComboBox1.SelectedItem = ComboBox1.Text Then
bFound = True
Exit For
End If
Next
If bFound = False Then
ComboBox1.Items.Add(ComboBox1.Text.ToString)
End If
End If
End Sub
Supra - 24 Sep 2004 10:47 GMT
i found this newsgroup...
i solved it:
it is item(i) instead of ComboBox1.SelectedItem
If ComboBox1.Items(i) = ComboBox1.Text Then
regards,
> How do i prevent duplicated in combobox ?
> Private Sub ComboBox1_KeyPress(ByVal sender As Object, ByVal e As
[quoted text clipped - 16 lines]
> End If
> End Sub