⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
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
  • Address feedback: Changed recommendation to SystemAware (default mode)

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)

  • Changed the recommended DPI mode from PerMonitorV2 to SystemAware, which is the default mode
  • Updated the description to clarify that SystemAware queries for DPI once at application startup and uses that value throughout the application's lifetime for consistent scaling behavior
  • 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 SystemAware mode (the default) for consistent scaling behavior
    • Lists all available DPI modes with descriptions
    • Provides code example for project configuration
    • Notes that app.manifest can override project settings (but is discouraged)
    • 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
    • Updated date to reflect major rewrite

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
  • ✅ Feedback addressed: Changed recommendation to SystemAware (default)
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

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.

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

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 +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 +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.
@adegeo
Copy link
Contributor

adegeo commented Jan 30, 2026

@copilot Change the recommendation to SystemAware. And it's also the default.

Copy link
Contributor Author

Copilot AI commented Jan 30, 2026

@copilot Change the recommendation to SystemAware. And it's also the default.

Changed the recommendation from PerMonitorV2 to SystemAware and clarified that SystemAware is the default mode. Updated the description to explain that SystemAware queries for DPI once at application startup and uses that value throughout the application's lifetime for consistent scaling behavior. (fb635ad)

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