I just started learning c# a week ago. I have a little experience with objective c. So give me a hard time for asking such a beginner question.
Well, I would like the user to be able to select from the combo box. I created the combobox visually in xaml. The contents of the combo box are strings. However, when the user selects their string of choice, I would like store a value to an int so I can do calculations. The errors I have been can't convert object to string and many other conversation errors.
int x;
string selValue = (string)comboBox1.SelectedValue;
if ((selValue=="green")||(selValue=="blue"))
{
x= 5;
}
Would it be best to create a function that accepts an object and returns an int, if so please tell ?