c# Get selected item text from combobox

2016/04/28 19:48 -



C# Combobox defined with name my_combobox
private System.Windows.Forms.ComboBox my_combobox;

Read the text of the selected combobox item and assign it to string variable, then show it in message box.

string selected_item_text = my_combobox.GetItemText(my_combobox.SelectedItem);MessageBox.Show(selected_item_text);