hi
I have a main form and a UserControl.
I do my own thing, I have a tool flowLayoutPanel1 in main form .
And move the User Control to the tool one by one in the form of rows on the main interface.
Everything is good so far.
The main problem is that I cannot control the tools within the user interface all together, but I can control one only through the user interface.
I want to do the following from the main interface loop on all the elements flowLayoutPanel
And every user control inside the tool, I want to change the background of the deletion button to red if the tot = 0 for each element
2-Second, delete all user control in flowLayoutPanel if the tot = 0

my try
//UserControl
public void changebutoncolor()
{
foreach (Control crt in this.Controls)
{
if (crt.lb_tot.Text=="0")
{
crt.bt_del.BackColor = Color.Red;
}
}
}
//call in main
UserControl2 usr = new UserControl2();
usr.changebutoncolor();
