What is the problem with this code?
for (int w = 0; w < this.Controls.Count; w++)
{
if (this.Controls[w] is TransparentLabel)
{
la = (TransparentLabel)this.Controls[w];
if (la.Name != "label1")
{
la.Visible = false;
la.Click -= new System.EventHandler(Clicked);
this.Controls.Remove(this.Controls[w]);
la.Dispose();
}
}
}
I want to clear the screen from the labels, but it doesn't work.