Esempio n. 1
0
        protected override void OnPanelCollapsing(object sender, ExpondStateChangeEventArgs e)
        {
            if ((this.Dock == DockStyle.Left) || (this.Dock == DockStyle.Right))
            {
                foreach (Control control in this.Controls)
                {
                    control.Hide();
                }
            }

            if ((this.Dock == DockStyle.Left) || (this.Dock == DockStyle.Right))
            {
                if (this.ClientRectangle.Width > this.CaptionHeight)
                {
                    this._restoreBounds = this.ClientRectangle;
                }
                this.Width = this.CaptionHeight;
            }

            if ((this.Dock == DockStyle.Top) || (this.Dock == DockStyle.Bottom))
            {
                if (this.ClientRectangle.Height > this.CaptionHeight)
                {
                    this._restoreBounds = this.ClientRectangle;
                }
                this.Height = this.CaptionHeight;
            }

            base.OnPanelCollapsing(sender, e);
        }
Esempio n. 2
0
        protected override void OnPanelExpanding(object sender, ExpondStateChangeEventArgs e)
        {
            bool bExpand = e.Expand;

            if (bExpand == true)
            {
                this.Expand = bExpand;
                this.Invalidate(false);
            }
            base.OnPanelExpanding(sender, e);
        }
Esempio n. 3
0
        protected override void OnPanelExpanding(object sender, ExpondStateChangeEventArgs e)
        {
            if ((this.Dock == DockStyle.Left) || (this.Dock == DockStyle.Right))
            {
                foreach (Control control in this.Controls)
                {
                    control.Show();
                }
                //When ClientRectangle.Width > CaptionHeight the panel size has changed
                //otherwise the captionclick event was executed
                if (this.ClientRectangle.Width == this.CaptionHeight)
                {
                    this.Width = this._restoreBounds.Width;
                }
            }
            if ((this.Dock == DockStyle.Top) || (this.Dock == DockStyle.Bottom))
            {
                this.Height = this._restoreBounds.Height;
            }

            base.OnPanelExpanding(sender, e);
        }