Consider a very basic form with a simple combo box
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.comboBox1.Items.Add("test1");
this.comboBox1.Items.Add("test2");
this.comboBox1.Items.Add("test3");
}
private void Form1_Load(object sender, EventArgs e)
{
this.comboBox1.SelectedIndexChanged += (o, args) =>
{
MessageBox.Show("Combo box changed!");
};
}
}
I have even changed the eventhandler to the below code. (Based on the linked question. Still the same problem)
this.comboBox1.SelectedValueChanged += (o, args) => //or even `Textchanged` event too
{
MessageBox.Show("Combo box changed!");
};
Expand the dropdown using mouse
and select any item using keyboard
.
The combo-box fires twice (The message box appears twice)
Any ideas why?