C# Windows Forms & ASP .NET MVC programming
Structured Query Language (SQL)
Smart Marine 3D Ship design
Tribon M3 / AVEVA Marine

c# Get selected item text from combobox

2017/10/18 06:03
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);