blah blah blah is here! blah blah » Close

up0down
link

Hey
I wish to show some messagebox based on the selected item in a combo box usinf if statements, how can i do this?
Thanks
Muhu

last answered 2 years ago

1 answers

up0down
link

To show the currently selected item in a combobox, you could use this code:
if (comboBox1.SelectedIndex > -1)
{
string selected = comboBox1.SelectedItem.ToString();
MessageBox.Show("Selected item is " + selected);
}

This post was imported from csharpfriends, if you have a similiar question please ask it again.

All previous members have been migrated, hope you enjoy the new platform!

Feedback