Im trying to delete all the buttons in my WinForm.But somehow, it keeps few buttons in the form. How can I remove all the buttons in my form?What is the mistake at my code?!
void ClearScreen()
{
foreach (Control c in this.Controls)
{
if (c is Button)
this.Controls.Remove(c);
}
}