diff --git a/TelegramBotBase/Base/FormBase.cs b/TelegramBotBase/Base/FormBase.cs index 4ed434f..75fdb20 100644 --- a/TelegramBotBase/Base/FormBase.cs +++ b/TelegramBotBase/Base/FormBase.cs @@ -410,6 +410,19 @@ namespace TelegramBotBase.Form this.Controls.Remove(control); } + /// + /// Removes all controls. + /// + public void RemoveAllControls() + { + foreach(var c in this.Controls) + { + c.Cleanup().Wait(); + + this.Controls.Remove(c); + } + } + /// /// Cleanup ///