0

I am having a list of items in combo box. in runtime if user feels to add new item to combo list he should be allowed to do the same just by typing new item in combo box typing area

4
Contributors
4
Replies
11
Views
2 Years
Discussion Span
Last Post by Shark_1
1

Actually you can do that all you need is a button(to signify when the typing is done) and a handler for its click event:

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
    If ComboBox1.Text <> "" AndAlso Not ComboBox1.Items.Contains(ComboBox1.Text) Then
        ComboBox1.Items.Add(ComboBox1.Text)
        ComboBox1.ResetText()
    End If
End Sub

Edited by tinstaafl

Votes + Comments
Perfect to do that
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.