Esempio n. 1
0
 public void Save(System.Windows.Forms.Form targetForm)
 {
     winState = targetForm.WindowState;
     brdStyle = targetForm.FormBorderStyle;
     topMost  = targetForm.TopMost;
     bounds   = targetForm.Bounds;
 }
Esempio n. 2
0
        private void popup_mode()
        {
            saved_state   = this.WindowState;
            saved_topMost = this.TopMost;

            this.WindowState = System.Windows.Forms.FormWindowState.Normal;
            this.TopMost     = true;

            saved_width   = this.Width;
            saved_height  = this.Height;
            saved_opacity = this.Opacity;
            saved_style   = this.FormBorderStyle;

            this.Width           = 800;
            this.Height          = 300;
            this.Opacity         = 0.90;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Region          = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, this.Width, this.Height, 20, 20));
        }
Esempio n. 3
0
        private void popup_mode()
        {
            saved_state = this.WindowState;
            saved_topMost = this.TopMost;

            this.WindowState = System.Windows.Forms.FormWindowState.Normal;
            this.TopMost = true;

            saved_width = this.Width;
            saved_height = this.Height;
            saved_opacity = this.Opacity;
            saved_style = this.FormBorderStyle;

            this.Width = 800;
            this.Height = 300;
            this.Opacity = 0.90;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, this.Width, this.Height, 20, 20));
        }
Esempio n. 4
0
        /// <summary>
        /// Enters fake full-screen mode. This method is thread-safe.
        /// </summary>
        /// <param name="resolution">The screen resolution to enter fake fullscreen mode in.</param>
        /// <returns>Whether the operation succeeded.</returns>
        public bool GoFakeFullScreen(DisplayResolution resolution)
        {
            bool succeeded = true;

            try
            {
                DisplayDevice.Default.ChangeResolution(resolution);
            }
            catch (GraphicsModeException)
            {
                succeeded = false;
            }

            if (!this.InFakeFullScreen && succeeded)
            {
                this.oldBorderStyle = this.FakeFullScreenForm.GetFormBorderStyle();
                this.FakeFullScreenForm.SetFormBorderStyle(System.Windows.Forms.FormBorderStyle.None);

                this.oldWindowState = this.FakeFullScreenForm.GetWindowState();
                this.FakeFullScreenForm.SetWindowState(System.Windows.Forms.FormWindowState.Maximized);

                this.FakeFullScreenForm.BringToFrontSafe();

                this.InFakeFullScreen = true;
            }

            return succeeded;
        }