Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

Rewrite autoscale article to reflect current DPI settings for modern .NET

  • Research modern .NET DPI handling (completed)
  • Update article frontmatter with ai-usage disclosure
  • Rewrite introduction to reflect modern .NET
  • Add modern .NET DPI configuration section
  • Update automatic scaling in action section for modern .NET
  • Add section on .NET Framework vs modern .NET differences
  • Apply Microsoft Style Guide transformations
  • Run code review (documentation-only, no code changes)
  • Run CodeQL security checker (documentation-only, no code changes)
  • Final verification (markdownlint passed)
  • Address feedback: Added note about app.manifest override capability
  • Address feedback: Added Visual Studio designer DPI considerations

Summary of Changes

This PR completely rewrites the autoscale.md article to accurately reflect how DPI handling works in modern .NET (6.0+) instead of .NET Framework.

Latest Updates (addressing feedback)

  • Added a subsection about Visual Studio designer considerations, including the ForceDesignerDPIUnaware property for .NET 6+ projects in Visual Studio 2022 17.8+
  • Added a NOTE explaining that while the recommended approach is to configure DPI through the project file, app.manifest can still be used to override these settings (though it's discouraged due to potential conflicts)

Technical Content Updates

  1. Added "DPI awareness in modern .NET" section - Explains how modern .NET (6+) handles DPI configuration differently:

    • Documents ApplicationHighDpiMode project property (default: SystemAware)
    • Recommends PerMonitorV2 mode for best multi-monitor scaling
    • Lists all available DPI modes with descriptions
    • Provides code example for project configuration
    • Notes that app.manifest can override project settings (but is discouraged)
    • NEW: Includes Visual Studio designer considerations with ForceDesignerDPIUnaware property
  2. Added "High DPI improvements" section - Details modern .NET improvements:

    • Per-monitor DPI awareness functionality
    • Improved scaling behavior for nested controls (.NET 6+)
    • Form size scaling for MaximumSize/MinimumSize (.NET 7+/8+)
    • New DPI change events (DpiChanged, DpiChangedBeforeParent, DpiChangedAfterParent)
    • Links to what's new articles for .NET 6, 7, and 8
  3. Added ".NET Framework differences" section - Clarifies configuration differences:

    • .NET Framework uses app.config with ApplicationConfigurationSection
    • Modern .NET uses project file with ApplicationHighDpiMode property
    • Notes that manifest files are no longer recommended
    • Links to .NET Framework high DPI documentation
  4. Updated existing content - Modernized all sections:

    • Updated "Automatic scaling in action" with correct grammar and style
    • Fixed ordered list numbering (1. for all items per style guide)
    • Improved clarity and removed .NET Framework-specific assumptions

Microsoft Style Guide Compliance

Applied comprehensive style transformations per the Markdown Writing Style Instructions:

  1. Voice and Tense

    • Active voice: "enables" → "lets", "will appear" → "appears"
    • Present tense: "will render" → "render", "will also appear" → "also appear"
    • Imperative mood: "can be overridden" → "Override"
    • Contractions: "are not" → "aren't", "does not" → "doesn't"
  2. Word Choice

    • Simplified: "seeks to address" → "addresses"
    • Direct: "you may scale" → "you can scale"
    • Removed weak constructions: "As implied above" removed
  3. Punctuation and Formatting

    • Added Oxford commas: "120, 144 and 192" → "120, 144, and 192"
    • Changed ordered list numbering: "01." → "1." for all items
    • Fixed spacing: "it current" → "its current"
    • Fixed typos: "Afterwards" → "Afterward"
  4. Metadata

    • Added ai-usage: ai-assisted to frontmatter
    • Updated description to be more specific
    • Added DPI-related keywords for discoverability

Verification Completed

  • ✅ Markdownlint passed with 0 errors
  • ✅ Code review tool confirmed documentation-only changes
  • ✅ CodeQL confirmed no code analysis needed
  • ✅ All links verified to exist in repository
  • ✅ Content technically accurate based on what's new articles and high-dpi documentation
  • ✅ Feedback addressed: Added manifest override clarification
  • ✅ Feedback addressed: Added Visual Studio designer DPI considerations
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>

<agent_instructions>DPI will operate slightly different between modern .NET and .NET Framework because of the changes that happened in the WinForms product for .NET 6+ releases. I think everything in this article was written for .NET Framework. We need to update the document to include how this also works on .NET. Check blog posts, whats new articles, and the WinForms source code for information about DPI changes.</agent_instructions>

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

Custom agent used: DocsEditor
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

…de updates

Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Copilot AI changed the title [WIP] Rewrite autoscale article to reflect current DPI settings Update autoscale article for modern .NET DPI handling Nov 17, 2025
Copilot AI requested a review from adegeo November 17, 2025 22:06
@adegeo
Copy link
Contributor

adegeo commented Jan 15, 2026

@copilot One thing I noticed is that it says it's configured through the project. While that is true, I believe you can still override it with the app manifest.

Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 15, 2026

@copilot One thing I noticed is that it says it's configured through the project. While that is true, I believe you can still override it with the app manifest.

Added a NOTE clarifying that app.manifest can still override the project file settings, though it's discouraged due to potential conflicts. The note links to the WFO0003 compiler warning documentation for more details. (63bc3bc)

@adegeo
Copy link
Contributor

adegeo commented Jan 15, 2026

…aware property

Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 15, 2026

@copilot We should mention something about the designer: https://learn.microsoft.com/en-us/visualstudio/designers/disable-dpi-awareness?view=visualstudio

Added a subsection about Visual Studio designer considerations, including the ForceDesignerDPIUnaware property for .NET 6+ projects in VS 2022 17.8+. This setting helps avoid rendering issues when designing forms on high-DPI monitors. (31fd7bc)

@adegeo adegeo marked this pull request as ready for review January 21, 2026 17:30
Copilot AI review requested due to automatic review settings January 21, 2026 17:30
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 comprehensively rewrites the autoscale.md article to reflect how DPI handling works in modern .NET (6.0+) instead of .NET Framework. The update addresses a documentation gap where the article was incorrectly describing .NET Framework behavior as current .NET behavior.

Changes:

  • Added new sections explaining modern .NET DPI configuration through project file properties
  • Added detailed information about high DPI improvements in .NET 6, 7, and 8
  • Added a section explaining differences between .NET Framework and modern .NET
  • Applied Microsoft Style Guide transformations throughout the document
  • Added AI-usage disclosure to frontmatter

Comment on lines +57 to +61
- `SystemAware`—The application queries for the DPI once at startup and uses this value for the lifetime of the app.
- `PerMonitor`—The application checks for DPI changes on a per-monitor basis and rescales when DPI changes.
- `PerMonitorV2`—Similar to `PerMonitor`, but enables child window DPI change notifications and improved scaling behavior.
- `DpiUnaware`—The application doesn't scale for DPI changes, and Windows handles the scaling.
- `DpiUnawareGdiScaled`—Similar to `DpiUnaware` but provides better quality for GDI-based content.
Copy link

Copilot AI Jan 21, 2026

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 modes are missing periods at the end of each item. According to the Microsoft Style Guide, list items that are complete sentences (or longer than three words) must end with periods. Each of these list items is a complete sentence describing what each mode does, so they should all end with periods.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +106 to +108
- **Per-monitor DPI awareness**—Applications dynamically adjust when moved between monitors with different DPI settings.
- **Improved scaling behavior**—Controls scale correctly when DPI changes, including nested controls and container controls (.NET 6+).
- **Form size scaling**<xref:System.Windows.Forms.Form.MaximumSize%2A> and <xref:System.Windows.Forms.Form.MinimumSize%2A> properties scale based on the current monitor DPI settings (.NET 7+, enabled by default in .NET 8+).
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list items describing High DPI improvements are missing periods at the end of each item. According to the Microsoft Style Guide, list items that are more than three words must end with periods. The first three list items (lines 106-108) are complete sentences or phrases that are longer than three words, so they should all end with periods. Note that line 109 correctly ends with a colon because it introduces nested items.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +120 to +123
- In .NET Framework, configure DPI awareness through an *app.config* file with the `<System.Windows.Forms.ApplicationConfigurationSection>` element.
- In modern .NET, configure DPI awareness through the project file with the `ApplicationHighDpiMode` property.
- .NET Framework uses manifest files for DPI configuration, which is no longer recommended.
- Modern .NET provides better scaling behavior and more reliable DPI change handling.
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list items describing .NET Framework differences are missing periods at the end of each item. According to the Microsoft Style Guide, list items that are more than three words must end with periods. These list items are complete sentences, so they should all end with periods.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +110 to +112
- <xref:System.Windows.Forms.Form.DpiChanged>—Fires when the DPI setting changes on the display device where the form is currently displayed.
- <xref:System.Windows.Forms.Control.DpiChangedBeforeParent>—Fires when the DPI setting for a control changes programmatically before a DPI change event for its parent control or form occurs.
- <xref:System.Windows.Forms.Control.DpiChangedAfterParent>—Fires when the DPI setting for a control changes programmatically after a DPI change event for its parent control or form occurs.
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nested list items describing DPI change events are missing periods at the end of each item. According to the Microsoft Style Guide, list items that are more than three words must end with periods. These list items are complete sentences describing what each event does, so they should all end with periods.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +96 to +100
- Override the <xref:System.Windows.Forms.Control.ScaleChildren%2A> property to determine if their child controls should be scaled.

- Override the <xref:System.Windows.Forms.Control.GetScaledBounds%2A> method to adjust the bounds that the control is scaled to, but not the scaling logic.

- Override the <xref:System.Windows.Forms.Control.ScaleControl%2A> method to change the scaling logic for the current control.
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nested list items describing how child controls can modify their scaling behavior are missing periods at the end of each item. According to the Microsoft Style Guide, list items that are more than three words must end with periods. These list items are complete sentences, so they should all end with periods.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines 88 to +92
- In response to the <xref:System.Windows.Forms.Control.OnFontChanged%2A> event if the scaling mode is <xref:System.Windows.Forms.AutoScaleMode.Font>.

- When the layout of the container control resumes and a change is detected in the <xref:System.Windows.Forms.ContainerControl.AutoScaleDimensions%2A> or <xref:System.Windows.Forms.ContainerControl.AutoScaleMode%2A> properties.

- 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.
- 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.
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nested list items describing situations when PerformAutoScale is invoked are missing periods at the end of each item. According to the Microsoft Style Guide, list items that are more than three words must end with periods. These list items are complete sentences, so they should all end with periods.

Copilot generated this review using guidance from repository custom instructions.
title: "Automatic form scaling"
description: "A look into how Windows Forms for .NET handles scaling the UI."
description: "Learn how Windows Forms for .NET handles scaling the UI with DPI awareness and automatic scaling modes."
ms.date: 10/26/2020
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The date in the frontmatter hasn't been updated to reflect this major rewrite of the article. Since this is a comprehensive update that significantly changes the content to reflect modern .NET (6.0+) instead of .NET Framework, the date should be updated to the current date when this PR is merged.

Suggested change
ms.date: 10/26/2020
ms.date: 01/21/2026

Copilot uses AI. Check for mistakes.
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