2
I would like to know how to implement in my combobox
one Messagebox
when selecting an item from the list?
Example:
Combo list:
- Junior
- Maria
- Joseph
When selecting Maria, a message box appears stating: You selected "Maria", OK button.
2
I would like to know how to implement in my combobox
one Messagebox
when selecting an item from the list?
Example:
Combo list:
When selecting Maria, a message box appears stating: You selected "Maria", OK button.
5
The ComboBox
has an event SelectedIndexChanged
, just implement it and add a MessageBox
to show the desired message.
Something like
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
MessageBox.Show($"Você selecionou o item {(sender as ComboBox).Text}");
}
To add the event to your component. In mode design from your form, select the component, right-click on it and then Properties. In the window of Properties click on the icon of Events (lightning) in the category Behavior, two-click on the event you want to create for the component, in this case the event SelectedIndexChanged
Browser other questions tagged c# winforms
You are not signed in. Login or sign up in order to post.
Jose edit your question and include the code with what you already tried.
– Caique Romero