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
380
Swap SplitContainer Panels
posted

Hello,

Does anyone know if it is possible to swap the two panels of a split container?
(i.e. Panel 1 will become Panel 2, and Panel 2 will become Panel 1).

Thanks for your time,

Katie

Parents
No Data
Reply
  • 5389
    Suggested Answer
    posted

    Katie,

    To do this with the UltraDockManager, you will need to get a reference to both DockAreaPanes and then re-dock them using the Dock method.  The code, in C# would look something like:

            private void ultraButton1_Click(object sender, EventArgs e)
            {
                DockableControlPane dcp1 = this.ultraDockManager1.PaneFromControl(this.ultraButton1);
                DockAreaPane dap1 = dcp1.DockAreaPane;
                DockableControlPane dcp2 = this.ultraDockManager1.PaneFromControl(this.ultraPanel1);
                DockAreaPane dap2 = dcp2.DockAreaPane;

                if (dap1.DockedLocation == DockedLocation.DockedLeft && dap2.DockedLocation == DockedLocation.DockedRight)
                {
                    dap2.Size = dap1.Size;
                    dap2.Dock(DockedSide.Left);
                    dap1.Dock(DockedSide.Right);
                }
                else
                {
                    dap1.Size = dap2.Size;
                    dap1.Dock(DockedSide.Left);
                    dap2.Dock(DockedSide.Right);
                }

     

    ~Kim~
            }

Children
No Data