Exemplo n.º 1
0
        /// <summary>
        /// MAXIMUM mode
        /// </summary>
        public void Form_SwitchTo_Maximum_Mode()
        {
            //if (!bMinModeEnabled) return;

            FORM_APPEARANCE_MODE = FormAppearanceMode.MODE_MAX;

            //hide min pannel
            //PanelShort.Visible = false;
            btnMaximize.Visible = false;

            //position min pannel
            PanelShort.Location = new Point(0, panelMaximum.Size.Height);


            //show maximum pannel
            panelMaximum.Visible = true;
            statusBar.Visible    = true;

            //change window size
            this.MinimumSize = new Size(Form_Normal_Width, panelMaximum.Size.Height + PanelShort.Size.Height + titleBarHeight + statusBarHeight + borderWidth * 2);
            this.MaximumSize = new Size(this.MinimumSize.Width, this.MinimumSize.Height);
            this.Size        = new Size(this.MinimumSize.Width, this.MinimumSize.Height);
            //this.ClientSize = new Size(this.ClientSize.Width, panelMaximum.Size.Height + statusBarHeight);

            //change window behaviour
            this.TopMost = false;
            this.Opacity = 1;
            if (this.FormBorderStyle != FormBorderStyle.Sizable)
            {
                this.FormBorderStyle = FormBorderStyle.Sizable;
            }
            this.Location = new Point(prevX, prevY);
        }
Exemplo n.º 2
0
        /// <summary>
        /// MINIMUM mode
        /// </summary>
        public void Form_SwitchTo_Short_Mode()
        {
            if (!bMinModeEnabled)
            {
                return;
            }

            //if maximized - switch to normal first
            if (this.WindowState == FormWindowState.Maximized)
            {
                this.WindowState = FormWindowState.Normal;
            }

            FORM_APPEARANCE_MODE = FormAppearanceMode.MODE_SHORT;

            //move to top
            this.Location = new Point(prevX, 0);
            //this.Update();

            //hide default pannel
            panelMaximum.Visible = false;
            statusBar.Visible    = false;

            //show minimum pannel
            PanelShort.Location = new Point(0, 0);
            PanelShort.Visible  = true;

            //change window behaviour
            this.TopMost         = true;
            this.Opacity         = 0.8;
            this.FormBorderStyle = FormBorderStyle.None;

            //change window size
            this.MinimumSize = new Size(Form_Normal_Width, PanelShort.Size.Height + 2);;
            this.MaximumSize = new Size(this.MinimumSize.Width, this.MinimumSize.Height);
            this.Size        = new Size(this.MinimumSize.Width, this.MinimumSize.Height);

            //show maximize button
            btnMaximize.Location = new Point(this.ClientSize.Width - btnMaximize.Width, 2);
            btnMaximize.Visible  = true;
        }