-
Notifications
You must be signed in to change notification settings - Fork 183
Rewrite autoscale article to reflect modern .NET DPI handling #2152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: adegeo <[email protected]>
Co-authored-by: adegeo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes the autoscale.md article to document .NET 6-9 DPI awareness configuration, replacing outdated .NET Framework content. The rewrite addresses user feedback that the article incorrectly reflected .NET Framework behavior instead of modern .NET DPI handling.
Key changes:
- Introduces
ApplicationHighDpiModeproject property andApplication.SetHighDpiMode()as the primary DPI configuration approach - Documents all
HighDpiModeenumeration values with clear guidance on when to use each - Adds runtime DPI change event handling section covering
DpiChanged,DpiChangedBeforeParent, andDpiChangedAfterParentevents - Relocates legacy
AutoScaleModecontent to a separate section marked for .NET Framework compatibility
| The <xref:System.Windows.Forms.HighDpiMode> enumeration defines several DPI awareness modes: | ||
|
|
||
| - As implied above, when a parent <xref:System.Windows.Forms.ContainerControl> is being scaled. Each container control is responsible for scaling its children using its own scaling factors and not the one from its parent container. | ||
| - **PerMonitorV2** (recommended): The application scales dynamically based on the DPI of each monitor. When you move a window between monitors with different DPI settings, Windows Forms automatically rescales the window and its contents. This mode provides the best user experience on systems with multiple monitors. |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list items in the DPI awareness modes section should end with periods since they exceed three words per the Markdown style guidelines. All five mode descriptions (PerMonitorV2, SystemAware, PerMonitor, DpiUnaware, DpiUnawareGdiScaled) need periods added at the end.
| - <xref:System.Windows.Forms.Form.DpiChanged>: Raised when the DPI of the monitor displaying the form changes. | ||
| - <xref:System.Windows.Forms.Control.DpiChangedBeforeParent>: Raised before a parent control or form handles a DPI change. | ||
| - <xref:System.Windows.Forms.Control.DpiChangedAfterParent>: Raised after a parent control or form handles a DPI change. |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list items describing DPI change events should end with periods since they exceed three words per the Markdown style guidelines. All three event descriptions need periods added at the end.
| - <xref:System.Windows.Forms.Control.ScaleChildren%2A>: Determines whether child controls should be scaled. | ||
| - <xref:System.Windows.Forms.Control.GetScaledBounds%2A>: Adjusts the bounds that the control scales to, but not the scaling logic. | ||
| - <xref:System.Windows.Forms.Control.ScaleControl%2A>: Changes the scaling logic for the current control. |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list items describing scaling customization methods should end with periods since they exceed three words per the Markdown style guidelines. All three method descriptions need periods added at the end.
Summary
Rewrites the autoscale.md article to document modern .NET (6-9) DPI awareness configuration instead of .NET Framework's
AutoScaleModeapproach.Fixes issue about article reflecting outdated .NET Framework DPI behavior.
Key Changes
Content restructure:
ApplicationHighDpiModeproject property andApplication.SetHighDpiMode()APIHighDpiModeenum values (PerMonitorV2, SystemAware, PerMonitor, DpiUnaware, DpiUnawareGdiScaled)AutoScaleModecontent to separate section marked for .NET Framework compatibilityConfiguration examples:
Project file approach (recommended):
Code-based approach:
Style guide compliance:
ai-usage: ai-assistedfrontmatterOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Internal previews