I am trying to create a simple inherited combobox control that has an items collection containing all of the US states. The control is working but has one problem. Each of the states are displayed twice during program execution. The following code snippet shows how I am populating the items collection of the control:
Any help will be appreciated.
VB.NET:
Public Class StateCombobox
Inherits ComboBox
Public Sub New()
MyBase.New()
MyBase.Items.Add("AL")
MyBase.Items.Add("AR")
MyBase.Items.Add("AZ")
MyBase.Items.Add("CA")
MyBase.Items.Add("CO")
MyBase.Items.Add("CT")
MyBase.Items.Add("DE")
…
…
MyBase.Items.Add("WV")
MyBase.Items.Add("WI")
MyBase.Items.Add("WY")
MyBase.MaxLength = 2
MyBase.Sorted = True
MyBase.AutoCompleteMode = Windows.Forms.AutoCompleteMode.Suggest
MyBase.AutoCompleteSource = Windows.Forms.AutoCompleteSource.ListItems
End Sub
Last edited by a moderator: