From bac0f32fd2faabfdcedfdb1ef45d7b417fd2cf78 Mon Sep 17 00:00:00 2001 From: Sunny Date: Sat, 20 Jul 2024 16:26:18 +0800 Subject: [PATCH] =?UTF-8?q?*=20UIForm2:=20=E4=BF=AE=E6=94=B9=E6=9C=80?= =?UTF-8?q?=E5=A4=A7=E5=8C=96=E6=97=B6=E6=8C=89=E9=92=AE=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Forms/UIForm2.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/SunnyUI/Forms/UIForm2.cs b/SunnyUI/Forms/UIForm2.cs index f43e8b93..84282759 100644 --- a/SunnyUI/Forms/UIForm2.cs +++ b/SunnyUI/Forms/UIForm2.cs @@ -339,7 +339,6 @@ namespace Sunny.UI private void ShowMaxOrNormal() { - Added = 16; if (!ShowFullScreen) { if (WindowState == FormWindowState.Maximized) @@ -393,7 +392,8 @@ namespace Sunny.UI } else { - if (FormBorderStyle == FormBorderStyle.Sizable) ShowMaxOrNormal(); + if (FormBorderStyle == FormBorderStyle.Sizable) + ShowMaxOrNormal(); } } @@ -408,23 +408,13 @@ namespace Sunny.UI Invalidate(); } - private int Added = 0; - protected override void CalcSystemBoxPos() { ControlBoxLeft = Width; if (ControlBox) { - if (WindowState == FormWindowState.Maximized) - { - ControlBoxRect = new Rectangle(Width - 6 - 28 - Added, titleHeight / 2 - 14, 28, 28); - } - else - { - ControlBoxRect = new Rectangle(Width - 6 - 28, titleHeight / 2 - 14, 28, 28); - } - + ControlBoxRect = new Rectangle(Width - 6 - 28, titleHeight / 2 - 14, 28, 28); ControlBoxLeft = ControlBoxRect.Left - 2; if (MaximizeBox) @@ -618,6 +608,8 @@ namespace Sunny.UI { winState = FormWindowState.Maximized; boundsCoreState = true; + CalcSystemBoxPos(); + Invalidate(); } else if ((int)m.WParam == Win32.User.SIZE_RESTORED) {