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
1104
Closing a DockableControlPane
posted

Hi,

I use UltraDockManager for displaying UserControls in tab form.

I use this code:

internal static class common

{

        public static DockableGroupPane grouppane;
        public static Form mainform;

}

static common()

{

            grouppane = new DockableGroupPane();
            grouppane.ChildPaneStyle = ChildPaneStyle.TabGroup;

}

To open a new pane programmatically:

public static void openPane(UserControl form)
        {

            mainform.SuspendLayout();

            var page = new DockableControlPane(form);

            grouppane.Panes.Add(page);

           
            page.Activate();

            mainform.ResumeLayout();
        }

 

The problem is:

When I click the "X" button of the DockableControlPane, the pane disappears, but is not really closed. It stays in the Panes collection of the DockableGroupPane.

E.g. if I want to open the same pane again after closing it before, i get an error "key exists in collection", because the pane was not correctly closed.

How can I completely close a pane, including the UserControl?

Please let me know if you need more information.

Best regards