I have a windows form with a primary tab control and multiple tabs (tabTest1, tabTest2, …, tabSettings). How can I split the single file generated by designer into smaller, more manageable files? I tried using partial class but this isn’t ideal for two reasons.
-
The event handler’s and designer code (regardless of which tab they are on) are generated on the same file.
-
I have to be overly verbose in my variable descriptions to keep things straight (tab to tab). For example, several “test tabs” have an “encoder” variable so I have to do something like
testOneEncoderValue,testTwoEncoderLabel, etc. Very annoying.
I am sure there is a better way (hence this question). Forgive my n00bness.
Thanks!
I would create a custom (container / user control) class respective of each “tab” and the controls in it. Then, just slap those individual controls on your tabbed interface as a single control. This way, it keeps the controls together as a single unit without the criss-cross… especially if you are dealing with say…. 100 controls?
Container/user control 1 has its (example)30 controls respective to Tab1
Container/user control 2 has its (example)18 controls respective to Tab2
Container/user control 3 has its (example)50 controls respective to Tab3
Then, on your main window of the tabbed page, just put the single control on each respective page. They are now in more manageable sub-components.