Windows Forms application (c#).
I have two ComboBoxes.
If I select an item in one, I want the text in the other one to be blank.
This is what I have:
private void ComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox2.Text = "";
}
private void ComboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox1.Text = "";
}
… but as you can see, when I make a selection in one, the text in both ComboBoxes get cleared.
How to accomplish this?
Thank you.
Try setting the ComboBox.SelectedIndex to -1
or rather based on your specifications try something lie