I have a bunch of tab pages that I want to show and hide using a menu. The main form opens with only one tab visible by default. If the user's level permits, they can view other tabs with information pertinent to their user level. I create the tabs at design time, and set their visible property to False. Then, at runtime, when a user selects a menu option to view one of the hidden tabs, I set the tab's visible property to true. My expectation was that the tab page would become visible, and now there would be two tabs in the tab control - the original tab, and the newly visible tab.
What is happening is that the tab page becomes visible, but it is showing up under the tab of the original page, effectively replacing the contents (or showing above the contents) of the original tab! There is still only one tab visible! If I then hide the tab by selecting the menu option to hide it, which sets the tab's visible property to false again, the original tab remains visible, and the original tab page content is again visible.
What is going on? Why doesn't the second tab, and its tab page, show up next to the original tab?