Winform
控件的动态删除请参考Winform控件动态删除
List<Button> listButton = new List<Button>(); foreach (var control in wrapPanelContainer.Children) { if(!(control is Button)) continue; var button = control as Button; if (!button.Name.Contains("BtnTable")) continue; listButton.Add(button); } foreach (Button control in listButton) wrapPanelContainer.Children.Remove(control);