Friday, 9 August 2013

How to Print Text from ComboBox into a MessageBox

How to Print Text from ComboBox into a MessageBox

Will this work using C#. I am trying to get the text out of a combobox to
compare and use. I just want to get the text that is selected in the
combobox and put it in a string.
string myText = "";
myText = comboBox1.GetItemText(comboBox1.SelectedItem);
MessageBox.Show(myText);
I am obviously new, but could use some help.

No comments:

Post a Comment