0

Maybe i am going the wrong way with this but for an application i make use of 2 TabControls.

The left one contains a menu the right one a bit of a preview page of how things wil be. The right tab menu i have the tab page selection hidden(Only able to hide them all not an individual) so they can't manually switch, depending on the left tab the right tab switches with it accordingly.

But here is the issue i am having, the left tab should only display certain tabs depending on account type. So is there a way to hide certain tabs?

If i remove them i can't get them back, so hiding would be preferential, or if possible perhaps move them to the right tabcontrol where they can't be manually selected?And move them back if the user changed?

  • 1
    @MongZhu winforms. –  Jun 25 '19 at 10:37
  • 2
    Check out this question: [Hiding and Showing TabPages in tabControl](https://stackoverflow.com/a/13086648) Mike's answer is pretty straightforward and easy to apply. – default locale Jun 25 '19 at 10:48
  • 1
    By the way, your second approach (moving tabs from one control to another) should also work. See another similar question: [Hiding TabPage from TabControl in Winform application](https://stackoverflow.com/a/30235293) – default locale Jun 25 '19 at 10:52

1 Answers1

0

I don't think I understand your question 100% but maybe do something like this to store a copy of your TabPage.

        var tempTabControl = new TabControl();
        tempTabControl.TabPages.Add(TC_NAME);
        mainTabControl.TabPages.Remove(TC_NAME);
demoncrate
  • 390
  • 2
  • 14