Exemplo n.º 1
0
        private void ZoomButton_Click(object sender, EventArgs e)
        {
            _log.Info("Zoom Button clicked");
            if (this.WindowState == FormWindowState.Maximized)
            {
                this.WindowState     = FormWindowState.Normal;
                ZoomButton.Image     = Properties.Resources.windowed;
                this.Location        = new Point(10, 10);
                this.Size            = new Size(Screen.PrimaryScreen.WorkingArea.Size.Width - 20, Screen.PrimaryScreen.WorkingArea.Size.Height - 20);
                this.FormBorderStyle = FormBorderStyle.FixedSingle;
                this.MaximizeBox     = this.MinimizeBox = TopMost = false;

                ControlPanel.BringToFront();
                ControlPanel.Visible = true;
                _hideTimer.Stop();
            }
            else
            {
                ControlPanel.Visible = false;
                this.FormBorderStyle = FormBorderStyle.None;
                this.WindowState     = FormWindowState.Maximized;
                ZoomButton.Image     = Properties.Resources.full_screen_icon_11769;
                TopMost = true;
            }
        }
Exemplo n.º 2
0
        private void OnMouseClick(object sender, EventArgs e)
        {
            if (this.WindowState == FormWindowState.Normal)
            {
                ControlPanel.BringToFront();
                ControlPanel.Visible = true;
                return;
            }

            if (_hideTimer.Enabled)
            {
                _hideTimer.Stop();
            }
            ControlPanel.BringToFront();
            ControlPanel.Visible = true;

            _hideTimer.Elapsed += OnHideTimer;
            _hideTimer.Interval = 5000;
            _hideTimer.Enabled  = true;
        }