Пример #1
0
        /// <summary>
        /// Show or Hide your WinForm in full screen mode.
        /// </summary>
        private void ScreenMode()
        {
            // set full screen
            if (!fullScreen)
            {
                // Get the WinForm properties
                borderStyle = form.FormBorderStyle;
                bounds      = form.Bounds;
                windowState = form.WindowState;

                // set to false to avoid site effect
                form.Visible = false;

                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     = windowState;
                form.FormBorderStyle = borderStyle;
                form.Bounds          = bounds;

                HandleTaskBar.showTaskBar();

                form.Visible = true;

                // Not in full screen mode
                fullScreen = false;
            }
        }
Пример #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();
 }