I have got four buttons in my form among four three buttons (btn2 btn3 btn4) have same color.
when btn1 is clicked it will check if btn2 btn3 and btn4 are of same color without explicitly stating what color to compare. but my condition does not seem to be right
should i state this
the code I’m using is:
private void btn1_Click(object sender, EventArgs e)
{
if (btn2.BackColor.Equals((btn3.BackColor) && (btn4.BackColor)))
{
MessageBox.Show("ALL BUTTONS ARE OF SAME COLOR");
}
}
Use this code to compare colors: