Peter
Attached you will find an example on how to work with single page.
technically you need to recreate the layout everytime you click on each menu item, to avoid this, sometimes is better to create a new child form of the mainform, but in this specific case i believe this is the best solution.
You do not also need to put the code in a code module, you usually do this to have your code tidy.
when dealing with several layouts, its better to have a child of the mainform.rootPane deal with the changes, so the menu will always be there.
i used a small example on a wait for call for animations, as the unloading and loading the layout was a bit odd.
So if I was re-using subs from multiple Modules then putting those subs as public in a Class would be best
For example, you want to have several forms with the same layout you will use a Class, in this case and because it is loaded in the mainform it would be too dificult if not impossible to manage it with a class.