I have an application in which there are 5 forms: a main menu which always exists and four forms that get created and destroyed from the main menu form.
On the main menu there are 5 buttons: Quit which destroys the four other forms, and one button for each of the four forms to display the associated form. When the user clicks on one of the button to show one of the four forms, it must check if the form is already created. If it is it shows it otherwise it first has to create it. When the Quit button on the main menu is clicked, the four other forms are destroyed (gracefully).
What is the best way of doing this ?