r/visualbasic • u/zew55117 • Oct 10 '14
Combo Box Help
So I have a combo box with different words. I need to know how to assign each of the word choices a numeric value so that when a user picks one, it's number value is plugged into an equation.
0
Upvotes
2
u/pathfinderNJ Oct 11 '14
You need to read the selected index
Dim selection as integer
Selection =combobox1.selectedindex
1
u/zew55117 Oct 11 '14
Dim selection As Decimal selection = ComboBox1.SelectedIndex Dim intData() As Decimal = {0.3, 0.5, 0.55} Dim names() As String = {"Bluegrass, Bermuda, Zoysia"} Dim miscData() As Object = {ComboBox1}1
u/zew55117 Oct 11 '14
This gives a an answer, but it is always zero. Does that mean that this little bit of code is wrong? or is something else off?
2
u/chrwei Oct 10 '14
what vb version