blah blah blah is here! blah blah » Close
Hey I wish to show some messagebox based on the selected item in a combo box usinf if statements, how can i do this?ThanksMuhu
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); }
answered 2 years ago by:
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!
Got feedack? Found a bug? report it here.
1 answers
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);
}
answered 2 years ago by:
17279
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!