I want to create and then destroy buttons, all with code, but can’t find anything that adequately explains the process.
Button btnQA1 = new Button();
greg.Children.Add(btnQA1);
btnQA1.Content = QA;
Grid.SetColumn(btnQA1, CRNOne);
How do I put that code above into a using statement? greg is the name of the grid I’m using.
You cannot destroy the button while the Grid is using it. It’s the responsibility of the grid to dispose of its children, just like any other containers