I have one combobox which has default items collections.
User can choose to write his/her own value in the combobox without using the default value hardcode in the list.
if user writes a string that is not found in the items collections, combobox will add the string, else nothing will be added.
vb
Private Sub cbxEcho_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbxEcho.TextChanged
If cbxEcho.Text <> "" And cbxEcho.FindStringExact(cbxEcho.Text) = 0 Then
cbxEcho.Items.Add(cbxEcho.Text)
My.Settings.Echos.Add(cbxEcho.Text)
End If
End Sub
I ran the program, i tried add a string which is the same as the one in the list, the combo box still add this string.
So it just adds any new string regardless whether the string is equal to the string in the list or not....
Am I doing it wrongly?