I am designing a customer invoice form in VB. I have created textboxes for customer input such as 1st name, last name, and address. I want to create a drop box for selection of state. How do I set this up?
Thanks from a rookie!
Printable View
I am designing a customer invoice form in VB. I have created textboxes for customer input such as 1st name, last name, and address. I want to create a drop box for selection of state. How do I set this up?
Thanks from a rookie!
I have chosen to use a combobox so that the user can select the State of their choice, but am not sure how to set write the code.
Would appreciate any suggestions.
You will use the AddItem method of the combobox control to
add the states to your list.
Example: This will add the state abbreviations for Alabama,
California, Nebraska, and South Dakota to a combobox
named cboBox1.
cboBox1.AddItem ("AL")
cboBox1.AddItem ("CA")
cboBox1.AddItem ("NE")
cboBox1.AddItem ("SD")
You could set up a text file or database table that
contains all the state names you want and then open the
file and loop thru the info to load your combobox.
Hope this helps.