Skip to content

AutoScale function does not work properly in .NET 8+ #14279

@rmkarasev

Description

@rmkarasev

Environment

Microsoft Visual Studio
Both versions 2026 and 2022

.NET version

.NET 8
The same behaviour on .NET 10

Did this work in a previous version of Visual Studio and/or previous .NET release?

It works on .NET 6.

Issue description

When project is setup with <ApplicationDefaultFont> property to customize default application font, and form inheritance is used, then AutoScale does not work properly neither in designer and runtime.

I see the similar issue #11214 and believe the root of issue is the same, but want to show another simple example how we are using the forms.
So you can create additional testing and ensure one more use-case works.

We are still use WinForms extensively, and it would be great if we could update our forms without manually patching Designer.cs files after each update.

Steps to reproduce

  1. Setup project with <ApplicationDefaultFont>Microsoft Sans Serif, 8.25pt</ApplicationDefaultFont>
  2. Create base form with Buttons -> BaseForm.
Image
  1. Create inherited form -> InheritedForm : BaseForm.

  2. Open InheritedForm in the designer, all buttons have bigger size

Image
  1. Open InheritedForm in runtime as dialog box from some main form, all buttons have smaller size.
Image

Simple project example:
WinFormsApp1.zip

Diagnostics


Metadata

Metadata

Assignees

Labels

area-VSDesignerWindows Forms out-of-proc designer related issues

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions