Both SelectedIndexChanged and SelectedValueChanged events of a combobox get fired when you click the combobox and then select from the dropdown list the item that is already currently selected. That is, even if the SelectedIndex or SelectedValue never changes, just the act of clicking on the currently selected item in the dropdown list causes the event to fire.
You can use the following solution too gets around the problem of firing an event when the user selects the currently selected item.
private System.Windows.Forms.ComboBox _valueTypeComboBox;
...
this._valueTypeComboBox.SelectedIndex = -1;
this._valueTypeComboBox.SelectedIndexChanged += new System.EventHandler(this._valueTypeComboBox_SelectedIndexChanged);
...
private void _valueTypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (this._valueTypeComboBox.SelectedValue != null)
{
if (this._valueTypeComboBox.Tag != this._valueTypeComboBox.SelectedValue)
{
this._valueTypeComboBox.Tag = this._valueTypeComboBox.SelectedValue;
//other code
}
}
}