25 pts.
 Adding Combo Boxes with numbers in their collection.
I have two combo boxes, each with a collection from 0 - 10.
A number has been generated using the randomize() function - between 1 - 20 and is shown in a label.text.
My problem involves the combo boxes not actually 'adding up' like numbers should. Maybe because they aren't actually number at all, I'm not sure.
So for example, the random number equals to 10.
You use the dropdown boxes to find the numbers that equal to 10. And so after that, when you click - I guess, an 'Enter' button, it doesn't equal.
I've been using this code:
If Combobox1.SelectedItem + Combobox2.SelectedItem = label3.text then
msgbox("correct")
end if
Am I on the right track?

Software/Hardware used:
Microsoft Visual basic 2010 Express
ASKED: Jul 18, 2011  10:59 AM GMT
UPDATED: March 31, 2012  9:09:30 PM GMT
25 pts.
  Help
 Approved Answer - Chosen by Carlosdl

Try converting the strings to integers:

Convert.ToInt32(ComboBox1.SelectedItem) + Convert.ToInt32(ComboBox2.SelectedItem)



Thank you! -Vertify-
ANSWERED:  Jul 19, 2011  8:34 AM (GMT)  by Vertify   25 pts.

 
Other Answers:
Try converting the strings to integers:

Convert.ToInt32(ComboBox1.SelectedItem) + Convert.ToInt32(ComboBox2.SelectedItem)



Thank you! -Vertify-
Last Wiki Answer Submitted:  Jul 19, 2011  8:34 AM (GMT)  by  Vertify   25 pts.
Latest Answer Wiki Contributors:  Carlosdl   60,245 pts.
To see other answers submitted to the Answer Wiki View Answer History.
Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _