'___________________________________________________________________________________________ ' U S A S T A T E S C O M B O B O X ' By Ron Kessler ' Created 12/26/06 '___________________________________________________________________________________________ 'Updated 12/26/06 'This combox box type control pre-loads the control with all the state abreviations. 'The calling application can set the initial state to whatever is appropriate for the area (RK_StatesListBox.SelectedText = "CA") 'I made a new constructor and put my initialzation code there. I could have put it inside the .Designer.C# file as well. 'The "Me" in this case refers to the new control itself, not a form like you are used to doing! Public Class RK_StatesListBox Inherits System.Windows.Forms.ComboBox Public Sub New() ' This call is required by the Windows Form Designer. InitializeComponent() Me.DropDownStyle = ComboBoxStyle.DropDownList Dim states() As String = {"AK", "AL", "AR", "AZ", "CA", "CO", "CT", "DC", "DE", _ "FL", "GA", "HI", "IA", "ID", "IL", "IN", _ "KS", "KY", "LA", "MA", "ME", "MD", "MI", "MN", "MO", _ "MS", "MT", "NC", "ND", "NE", _ "NH", "NJ", "NM", "NV", "NY", _ "OH", "OK", "OR", "PA", "RI", _ "SC", "SD", "TN", "TX", "UT", _ "VA", "VT", "WA", "WI", "WV", "WY"} Dim x As Integer = 0 For x = 0 To 49 Me.Items.Add(states(x)) Next End Sub End Class