Beispiel #1
0
        /// <summary>
        /// Show or Hide your WinForm in full screen mode.
        /// </summary>
        private void ScreenMode()
        {
            //_Form.SuspendLayout();
            // set full screen
            if (!_FullScreen)
            {
                // Get the WinForm properties
                _cBorderStyle = _Form.FormBorderStyle;
                _cBounds      = _Form.Bounds;
                _cWindowState = _Form.WindowState;
                // set to false to avoid site effect
                _Form.Visible = false;
                _Form.TopMost = true;
                HandleTaskBar.hideTaskBar();

                // set new properties
                _Form.FormBorderStyle = FormBorderStyle.None;
                _Form.WindowState     = FormWindowState.Maximized;

                _Form.Visible = true;
                _FullScreen   = true;
            }
            else  // reset full screen
            {
                // reset the normal WinForm properties
                // always set WinForm.Visible to false to avoid site effect
                _Form.Visible         = false;
                _Form.WindowState     = _cWindowState;
                _Form.FormBorderStyle = _cBorderStyle;
                _Form.Bounds          = _cBounds;
                HandleTaskBar.showTaskBar();
                _Form.Visible = true;
                _Form.TopMost = false;
                // Not in full screen mode
                _FullScreen = false;
            }
            //_Form.ResumeLayout(false);
        }
Beispiel #2
0
 /// <summary>
 /// You can use this to reset the Taskbar in case of error.
 /// I don't want to handle exception in this class.
 /// You can change it if you like!
 /// </summary>
 public void ResetTaskBar()
 {
     HandleTaskBar.showTaskBar();
 }