Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i, n, j As Integer j = 1 n = DropDownList1.Items.Count If n = 0 Then DropDownList1.Items.Add(TextBox1.Text) Else For i = 0 To n - 1 If TextBox1.Text = DropDownList1.Items(i).Text Then j = j + 1 End If Next If j = 2 Then MsgBox("Already available") Else DropDownList1.Items.Add(TextBox1.Text) End If End If End Sub