Add items in combobox windows form using VB.Net

In this article we will learn Add items in combobox windows form using VB.Net.

In this blog we will see step by step Add items in combobox windows form using VB.Net

Step 1. We will add one ComboBox, one textbox, one label and one button on windows form.

Step 2. In this step we will change the text of label and button. Need to open properties of label and button for change text and Name just like given below screenshot.

Step 3. In this step we will open properties of ComboBox and select AutoCompleteMode in SuggestAppend and AutoCompleteSource in ListItems

AutoCompleteMode Specifies the mode for the automatic completion feature used in the ComboBox.
AutoCompleteSource Specifies the source for ComboBox and TextBox automatic completion functionality.
ListItems Specifies that the items of the ComboBox represent the source.
SuggestAppend is generally Applies both Suggest and Append options.

Step 4. In this step we will double click on Add button for generate click event. After double click Form1.vb page will open.

Step 4. Write this code in Form1.vb page under generated click event for add items in combobox windows form using VB.Net.

comboBox1 is the name of listbox
textBox1 is the name of textbox
item: An object representing the item to add to the collection.
Add : Add an items in listbox


Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
If TextBox1.Text <> “” Then
MessageBox.Show(“Item is added in ComboBox”)
MessageBox.Show(“Please enter item in TextBox”)
End If
End Sub


Leave a Reply

Your email address will not be published.