Skip to content

Commit 5321de7

Browse files
authored
V105-LTS #3013 : Maximized form's size exceeds the screen's working area (#3150)
// Fix for #3013 : This change restores the original implementation of UpdateRegionForMaximized.
2 parents d1ddaa2 + de4a63f commit 5321de7

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

Documents/Changelog/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
## 2026-04-20 - Build 2604 (Version 105-LTS - Patch 2) - April 2026
4848

49+
* Resolved [#3013](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3013), Maximized form's size exceeds the screen's working area
4950
* Implemented [#3173](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3173), Use pattern matching
5051
* Resolved [#3201](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3201), Resolves potential memory leaks in `KryptonDataGridViewRatingColumn`
5152
* Resolved [#3163](https://github.com/Krypton-Suite/Standard-Toolkit/issues/3163), Form Icon Misplaced in Contextual Tabs

Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2634,27 +2634,32 @@ private void PerformViewPaint(Graphics g, Rectangle rect)
26342634
}
26352635
}
26362636

2637-
private void UpdateRegionForMaximized()
2638-
{
2639-
if (MdiParent == null)
2640-
{
2641-
// Fix for #2457 / #3012: Do not apply a clipping region when maximized.
2642-
// For RTL layout mode, disable region clipping to prevent border issues (#2457).
2643-
// For all maximized forms, skip region so the title bar, control box, and left/top/bottom
2644-
// edges are not cut off (#3012 - controlbox and buttonspace not show full when maximized).
2645-
SuspendPaint();
2646-
_regionWindowState = FormWindowState.Maximized;
2647-
UpdateBorderRegion(null);
2648-
ResumePaint();
2649-
}
2650-
else
2651-
{
2652-
// As a maximized Mdi Child we do not need any border region
2653-
UpdateBorderRegion(null);
2654-
}
2655-
}
2656-
2657-
private void UpdateBorderRegion(Region? newRegion)
2637+
// Fix for #3013 : This change restores the original implementation of UpdateRegionForMaximized.
2638+
private void UpdateRegionForMaximized()
2639+
{
2640+
if (MdiParent == null)
2641+
{
2642+
// Get the size of each window border
2643+
Padding padding = RealWindowBorders;
2644+
2645+
// Reduce the Bounds by the padding on all but the top
2646+
var maximizedRect = new Rectangle(padding.Left, padding.Left, Width - padding.Horizontal,
2647+
Height - padding.Left - padding.Bottom);
2648+
2649+
// Use this as the new region
2650+
SuspendPaint();
2651+
_regionWindowState = FormWindowState.Maximized;
2652+
UpdateBorderRegion(new Region(maximizedRect));
2653+
ResumePaint();
2654+
}
2655+
else
2656+
{
2657+
// As a maximized Mdi Child we do not need any border region
2658+
UpdateBorderRegion(null);
2659+
}
2660+
}
2661+
2662+
private void UpdateBorderRegion(Region? newRegion)
26582663
{
26592664
if ((newRegion != null)
26602665
&& (newRegion.IsEmpty(CreateGraphics()))

0 commit comments

Comments
 (0)