Reputation: 4562
Forgive the probably silly question - I'm not used to working with GUIs.
I've got a TabControl that's been prebuilt in the designer. There are many tabs, but only certain ones need to show up based on a variable at the time of loading the form. I originally tried using the Remove command on the FormLoad to remove the unneeded tabs, but because there are multiple tabs with multiple additional objects in each tab, they visibly load and then disappear and it's rather ugly.
Thank you.
Upvotes: 2
Views: 94
Reputation: 61540
Call Remove
in the form constructor, right after InitializeComponents
. That happens way before the form is shown.
Upvotes: 1
Reputation: 11903
Design your tabs contents as usercontrols. On the main form, each tab only contains a single control. If you want load-on-demand, then make tabs empty in the designer, and put the corresponding usercontrol in the tab when it's first shown.
Upvotes: 1