I have the following code to change the color of the buttons that are in a panel:
private void mudaCorBotao(Button bt)
{
foreach(Control b in Panel_esq.Controls)
{
if (/*[O que devo colocar aqui?]*/)
{
b.BackColor = SystemColors.HotTrack;
b.ForeColor = Color.White;
}
}
bt.BackColor = Color.White;
bt.ForeColor = Color.Black
}
What I'm trying to do is: When the user clicks any button on this panel, it will return all the other buttons to the default color and put the button clicked on a different color. But I have no idea what I should put inside this if
.