I have a form where there are 2 buttons, one which randomly adds buttons onto the form, and one that resets the form to default.
When the form is opened there are two buttons, but after clicking the random button, there are many buttons.
For the reset button, I currently use:
MainForm.free;
Application.CreateForm(TMainForm, MainForm);
Application.Run;
Is there a (better) different way?