Exemplo n.º 1
0
        /// <summary>
        /// 设置分栏样式高设置
        /// </summary>
        /// <param name="TargetSc"></param>
        /// <param name="Sr"></param>
        protected void SetPanelStyleVertical(SplitContainer TargetSc, SplitRegion Sr)
        {
            bool tophas  = IsSetChild(TargetSc.Panel1);
            bool downhas = IsSetChild(TargetSc.Panel2);

            //上有下没有
            if (tophas && !downhas)
            {
                this.SetSplitterDis(TargetSc, TargetSc.Height);
            }
            //上有下有
            if (tophas && downhas)
            {
                this.SetSplitterDis(TargetSc, Sr.Height);
            }
            //上没有下有
            if (!tophas && downhas)
            {
                this.SetSplitterDis(TargetSc, 0);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 设置分栏样式高设置
        /// </summary>
        /// <param name="TargetSc"></param>
        /// <param name="Sr"></param>
        protected void SetPanelStyleHorizontal(SplitContainer TargetSc, SplitRegion Sr)
        {
            bool lefthas  = IsSetChild(TargetSc.Panel1);
            bool righthas = IsSetChild(TargetSc.Panel2);

            //左有右没有
            if (lefthas && !righthas)
            {
                this.SetSplitterDis(TargetSc, TargetSc.Width);
            }
            else
            {
            }
            //左有右有
            if (lefthas && righthas)
            {
                this.SetSplitterDis(TargetSc, Sr.Width);
            }
            //左没有右有
            if (lefthas && righthas)
            {
                this.SetSplitterDis(TargetSc, 0);
            }
        }