audio_uphoria
Active member
- Joined
- Jan 28, 2009
- Messages
- 31
- Programming Experience
- Beginner
Hello, I'm setting up a program where I would like the user to be able to select a state from a combo box. I can not figure out how to allow to select the abbreviation from the drop down list and also allow them to type a letter and it will select the state from the state or just allow them to type the full abbreviation that would match what is already in the list. It is supposed to be in the drop down list style. I would also like to confirm that the user has chosen a state before allowing them to click a submit button but I'm not sure how to go about confirming it. Any help appreciated. Thanks.
VB.NET:
Private Sub FrmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' Inserts state abbreviations in combo box
cboState.SelectedItem = " "
cboState.Items.Add(" ")
cboState.Items.Add("AL")
cboState.Items.Add("AK")
cboState.Items.Add("AZ")
cboState.Items.Add("AR")
cboState.Items.Add("CA")
cboState.Items.Add("CO")
cboState.Items.Add("CT")
cboState.Items.Add("DE")
cboState.Items.Add("DC")
cboState.Items.Add("FL")
cboState.Items.Add("GA")
cboState.Items.Add("HI")
cboState.Items.Add("ID")
cboState.Items.Add("IL")
cboState.Items.Add("IN")
cboState.Items.Add("IA")
cboState.Items.Add("KS")
cboState.Items.Add("KY")
cboState.Items.Add("LA")
cboState.Items.Add("ME")
cboState.Items.Add("MD")
cboState.Items.Add("MA")
cboState.Items.Add("MI")
cboState.Items.Add("MN")
cboState.Items.Add("MS")
cboState.Items.Add("MO")
cboState.Items.Add("MT")
cboState.Items.Add("NE")
cboState.Items.Add("NV")
cboState.Items.Add("NH")
cboState.Items.Add("NJ")
cboState.Items.Add("NM")
cboState.Items.Add("NY")
cboState.Items.Add("NC")
cboState.Items.Add("ND")
cboState.Items.Add("OH")
cboState.Items.Add("OK")
cboState.Items.Add("OR")
cboState.Items.Add("PA")
cboState.Items.Add("RI")
cboState.Items.Add("SC")
cboState.Items.Add("SD")
cboState.Items.Add("TN")
cboState.Items.Add("TX")
cboState.Items.Add("UT")
cboState.Items.Add("VT")
cboState.Items.Add("VA")
cboState.Items.Add("WA")
cboState.Items.Add("WV")
cboState.Items.Add("WI")
cboState.Items.Add("WY")
End Sub