I am trying to build a wizard by using the TabControl component.
It works fine, but I end up with so many pages (tabs) that having all the components and event handlers in one class makes it unreadable.
I now have this idea of declaring each step of the wizard in a separate class which extends from TabPage, then adding those steps to the wizard screen class (which extends from TabControl). How do I do that and still get designer support in the steps?
Simply extending TabPage doesn’t enable designer support.
Thanks in advance.
I would suggest splitting your business logic from your UI logic. Create
UserControlderivatives for both the contents of eachTabPageas well as theTabControlitself. It’s a lot easier to manage this kind of code if the UI logic is separate from the business logic. You would probably benefit from creating a class for each tab, and a class that manages all the tabs. Hook these classes up to theUserControls that are on theTabPages and theTabControl.