Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 12, 2025

Summary

Rewrites the autoscale.md article to document modern .NET (6-9) DPI awareness configuration instead of .NET Framework's AutoScaleMode approach.

Fixes issue about article reflecting outdated .NET Framework DPI behavior.

Key Changes

Content restructure:

  • Lead with ApplicationHighDpiMode project property and Application.SetHighDpiMode() API
  • Document all HighDpiMode enum values (PerMonitorV2, SystemAware, PerMonitor, DpiUnaware, DpiUnawareGdiScaled)
  • Add runtime DPI change event handling section
  • Move legacy AutoScaleMode content to separate section marked for .NET Framework compatibility

Configuration examples:

Project file approach (recommended):

<PropertyGroup>
  <ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
</PropertyGroup>

Code-based approach:

ApplicationConfiguration.Initialize();
Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);
Application.Run(new Form1());

Style guide compliance:

  • Active voice throughout
  • Imperative mood for instructions
  • Contractions where appropriate
  • Simplified technical phrasing
  • Added ai-usage: ai-assisted frontmatter
Original prompt

This section details on the original issue you should resolve

<issue_title>Rewrite autoscale article to reflect current DPI settings</issue_title>
<issue_description>### Type of issue

Typo

Description

This article needs a rewrite. It currently reflects how DPI is working in .NET Framework and not in .NET 9+.

Page URL

https://learn.microsoft.com/en-us/dotnet/desktop/winforms/forms/autoscale?view=netdesktop-9.0

Content source URL

https://github.com/dotnet/docs-desktop/blob/main/dotnet-desktop-guide/net/winforms/forms/autoscale.md

Document Version Independent Id

1aaf7424-82fb-ad59-b088-8ba2390fcd8c

Platform Id

f8ee52a9-4357-d487-4c01-bf6ae2a7feaf

Article author

@adegeo

Metadata

  • ID: 6bdfb610-861b-9a50-5a81-3416ec1d9cdc
  • PlatformId: f8ee52a9-4357-d487-4c01-bf6ae2a7feaf
  • Service: dotnet-desktop
  • Sub-service: winforms

Related Issues</issue_description>

Comments on the Issue (you are @copilot in this section)

Custom agent used: Documentation Editor
Edit and transform a document using the Microsoft Style Guide


✨ 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

📄 File 🔗 Preview link
dotnet-desktop-guide/winforms/forms/autoscale.md dotnet-desktop-guide/winforms/forms/autoscale

Copilot AI changed the title [WIP] Rewrite autoscale article for .NET 9+ DPI settings Rewrite autoscale article to reflect modern .NET DPI handling Nov 12, 2025
Copilot finished work on behalf of adegeo November 12, 2025 23:04
Copilot AI requested a review from adegeo November 12, 2025 23:04
@adegeo adegeo marked this pull request as ready for review November 13, 2025 17:39
Copilot AI review requested due to automatic review settings November 13, 2025 17:39
Copilot finished reviewing on behalf of adegeo November 13, 2025 17:41
Copy link
Contributor

Copilot AI left a 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 ApplicationHighDpiMode project property and Application.SetHighDpiMode() as the primary DPI configuration approach
  • Documents all HighDpiMode enumeration values with clear guidance on when to use each
  • Adds runtime DPI change event handling section covering DpiChanged, DpiChangedBeforeParent, and DpiChangedAfterParent events
  • Relocates legacy AutoScaleMode content 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.
Copy link

Copilot AI Nov 13, 2025

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.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +82 to +84
- <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.
Copy link

Copilot AI Nov 13, 2025

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.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +107 to +109
- <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.
Copy link

Copilot AI Nov 13, 2025

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.

Copilot generated this review using guidance from repository custom instructions.
@adegeo adegeo closed this Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite autoscale article to reflect current DPI settings

2 participants