View Full Version : c# simple combobox

06-30-2008, 09:26 AM
Okay, So I have a ComboBox named mycombo with 2 options, "string1" and "string2".

I have a form with a button that when they click the button it validates the form.

All my question is, is simply how do I get the text of what they choose.

Something like:

string choice = mycombo.SelectedText
if (choice == "string1")
{// blah blah blah

or string choice = mycombo.SelectedItem.ToString();

However, none of them work, they all end up blank or throwing an error of sorts. I'm sure its something really quite simple, but for the life of me I can't figure it out.

06-30-2008, 04:10 PM