S
Supra
does ne 1 know how to prevent duplicated in combobox? i convert from
vb6 to vb.net. but in vb6 would work.
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
e.Handled = True
AxWebBrowser1.Navigate(ComboBox1.Text.ToString)
Dim bFound As Boolean
bFound = False
For i As Integer = 1 To ComboBox1.Items.Count
If ComboBox1.SelectedItem = ComboBox1.Text.ToString Then
bFound = True
Exit For
End If
Next
If bFound = False Then
ComboBox1.Items.Add(ComboBox1.Text.ToString)
End If
End If
End Sub
vb6 to vb.net. but in vb6 would work.
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
e.Handled = True
AxWebBrowser1.Navigate(ComboBox1.Text.ToString)
Dim bFound As Boolean
bFound = False
For i As Integer = 1 To ComboBox1.Items.Count
If ComboBox1.SelectedItem = ComboBox1.Text.ToString Then
bFound = True
Exit For
End If
Next
If bFound = False Then
ComboBox1.Items.Add(ComboBox1.Text.ToString)
End If
End If
End Sub