WeifenLuo.WinFormsUI.Docking.DockPane.SetNestedDockingProportion C# (CSharp) Method

SetNestedDockingProportion() public method

public SetNestedDockingProportion ( double proportion ) : void
proportion double
return void
        public void SetNestedDockingProportion(double proportion)
        {
            NestedDockingStatus.SetStatus(NestedDockingStatus.NestedPanes, NestedDockingStatus.PreviousPane, NestedDockingStatus.Alignment, proportion);
            if (NestedPanesContainer != null)
                ((Control)NestedPanesContainer).PerformLayout();
        }

Usage Example

Example #1
0
            void ISplitterDragSource.MoveSplitter(int offset)
            {
                NestedDockingStatus status = DockPane.NestedDockingStatus;
                double proportion          = status.Proportion;

                if (status.LogicalBounds.Width <= 0 || status.LogicalBounds.Height <= 0)
                {
                    return;
                }
                else if (status.DisplayingAlignment == DockAlignment.Left)
                {
                    proportion += ((double)offset) / (double)status.LogicalBounds.Width;
                }
                else if (status.DisplayingAlignment == DockAlignment.Right)
                {
                    proportion -= ((double)offset) / (double)status.LogicalBounds.Width;
                }
                else if (status.DisplayingAlignment == DockAlignment.Top)
                {
                    proportion += ((double)offset) / (double)status.LogicalBounds.Height;
                }
                else
                {
                    proportion -= ((double)offset) / (double)status.LogicalBounds.Height;
                }

                DockPane.SetNestedDockingProportion(proportion);
            }