Пример #1
0
        public virtual void EnterFullScreen()
        {
            if (this.FullScreen)
            {
                return;
            }

            FullScreenInfo info = new FullScreenInfo(this.Parent, this.Bounds);

            info.MdiParent     = this.MdiParent;
            info.TopLevel      = this.TopLevel;
            info.BorderStyle   = this.FormBorderStyle;
            info.TopMost       = this.TopMost;
            info.WindowState   = this.WindowState;
            info.ShowInTaskbar = this.ShowInTaskbar;
            info.Owner         = this.Owner;

            MdiParent = null;
            Parent    = null;
            TopLevel  = true;
            if (info.Parent != null && info.Parent.TopLevelControl is Form)
            {
                Owner = (Form)info.Parent.TopLevelControl;
            }
            //TopMost = true;
            FormBorderStyle = FormBorderStyle.None;
            WindowState     = FormWindowState.Normal;
            Bounds          = Screen.GetBounds(Program.MainForm);
            ShowInTaskbar   = false;

            FullScreenInfomation = info;
        }
Пример #2
0
        public virtual void ExitFullScreen()
        {
            if (!this.FullScreen)
            {
                return;
            }

            if (this.FullScreenInfomation != null)
            {
                FullScreenInfo info = FullScreenInfomation;
                TopLevel        = info.TopLevel;
                MdiParent       = info.MdiParent;
                Parent          = info.Parent;
                FormBorderStyle = info.BorderStyle;
                WindowState     = info.WindowState;
                Bounds          = info.Bounds;
                TopMost         = info.TopMost;
                Owner           = info.Owner;
                ShowInTaskbar   = info.ShowInTaskbar;
            }
        }