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: July 18, 2011  10:59 AM
UPDATED: March 31, 2012  9:09 PM

Answer Wiki:
Try converting the strings to integers: <pre><b>Convert.ToInt32</b>(ComboBox1.SelectedItem) + <b>Convert.ToInt32</b>(ComboBox2.SelectedItem) </pre> Thank you! -Vertify-
Last Wiki Answer Submitted:  July 19, 2011  8:34 am  by  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _