I have a VCL form with a five tab TPageControl
on it. Each TTabSheet
's content is fairly unrelated and has a lot of individual controls and processing logic...so I want to break it up so it's easier to deal with the code for "just that tab". Having a line like
//-------------------------- begin rules tab methods -------------------
just isn't cutting it anymore. Really, I think I'd like each tab in a separate file somehow.
Currently I'm contemplating creating a VCL Frame for each TTabPage. If I did so I'd either need to load all the frames into the TPageControl in the constructor, or when the tab is shown.
Is this a good approach? Would it be better to make a whole TForm for each tab? Should I continue to wrap the tabs in a TPageControl, or should that be changed to a TTabControl if the content is loaded dynamically? If this is a good approach, is it better to load all the tabs on startup, or each time the tab is shown? (perhaps pros/cons if it's not totally obvious which is better in most/all cases)
You can use either Frames or Forms.
Example
Create a base Settings Form
Derive all Settings Forms from that Form and override the
DoSaveData
and optionally theCanSaveData
methodsCommon Settings (with a simple CheckBox)
Connection Settings (with a simple Edit control)
Putting the pieces together: The real Settings Form
The main Setting Form is also derived from the SettingBase