Update FormBase.cs

- adding RemoveAllControls method
This commit is contained in:
FlorianDahn 2020-07-25 15:07:36 +02:00
parent 47876681e0
commit 7a7a65c3a7

View File

@ -410,6 +410,19 @@ namespace TelegramBotBase.Form
this.Controls.Remove(control);
}
/// <summary>
/// Removes all controls.
/// </summary>
public void RemoveAllControls()
{
foreach(var c in this.Controls)
{
c.Cleanup().Wait();
this.Controls.Remove(c);
}
}
/// <summary>
/// Cleanup
/// </summary>