Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
120
How to hide TabPage when double-clicking a tab in tabcontrol?
posted

Hi,

Now I have a tabcontrol as a top menu, I want to add a new feature to the tabcontrol, Double-click the tab to hide the TabPage,
my initial design was to double-click the Tab to make the height of the Tabpage become 0 to hide the TabPage.
But now I dockeded the tabControl to the top by UltraDockManager, I can't hide DockArea.
How can I achieve this?

Parents
  • 1560
    Offline posted

    Hello Stan,

    My suggestion is to use the Closed property on the panes.  When Closed is set to true, the pane will not be visible.  When Closed is false the pane is visible.  

    Setting Closed to true sometimes causes the pane to be removed from the associated DockAreaPane, so you may need to add the pane to the DockAreaPane in that case. 
    Panes could be hidden and shown easily using the Close and Show methods on the pane. For example,  the following code could be used in order to hide a specific pane:
     

    ultraDockManager1.ControlPanes["tabPane"].Close();
     

    And this code when you want to show it: 

    ultraDockManager1.ControlPanes["tabPane"].Show();
     

    Please let me know whether this works for you. If this is not an accurate demonstration of what you are trying to achieve please feel free to provide your own sample. Remove any external dependencies and code that is not directly related to the issue, zip your application and attach in in this case. 

    Having a working sample on my side, which I can debug, is going to be very helpful in finding the root cause of this behavior. 

    Thank you for your cooperation. 

    Sincerely,
    Teodosia Hristodorova
    Associate Software Developer

Reply Children