How do I create a TabControl with no tab headers?

后端 未结 5 1555
深忆病人
深忆病人 2020-12-15 14:12

How do I make a tab manager that doesn\'t show the tab headers?

This is a winforms application, and the purpose of using a tab manager is so the display content can

5条回答
  •  悲哀的现实
    2020-12-15 14:54

    I guess, that using panels is the simplest solution. In addition, I suggest using my (free, opensource) VisualStateManager to simplify switching and eliminate lots of .Enabled = true horrors.

    Package is available on Nuget.

    Just write this code:

    // Contains and propagates information about current page
    private SwitchCondition settingPageCondition;
    // Controls state of specific controls basing on given SwitchCondition
    private VisualStateSwitchController settingPageController;
    
    // (...)
    
    private void InitializeActions()
    {
        // Initialize with possible options
        settingPageCondition = new SwitchCondition(0, 1);
    
        settingPageController = new VisualStateSwitchController(
            null,                  // Enabled is not controlled
            null,                  // Checked is not controlled
            settingPageCondition,  // Visible is controller by settingPageCondition
            new SwitchControlSet(0, pGeneral),   // State 0 controls pGeneral
            new SwitchControlSet(1, pParsing));  // State 1 controls pParsing
    }
    
    // (...)
    
    public void MainForm()
    {
        InitializeComponent();
        InitializeActions();
    }
    
    // (...)
    
    // Wat to set specific page
    settingPageCondition.Current = 0;
    

提交回复
热议问题