dotnet / dotnet/winforms

AutoScale function does not work properly in .NET 8+

Open
#14,279 9 comments 0 reactions 1 assignee Claimed by @SimonZhao888 View on GitHub
area-VSDesigner
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

### 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 `` 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 https://github.com/dotnet/winforms/issues/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 `Microsoft Sans Serif, 8.25pt`
2. Create base form with Buttons -> BaseForm.

Image

3. Create inherited form -> InheritedForm : BaseForm.

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

Image

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

Image

Simple project example:
[WinFormsApp1.zip](https://github.com/user-attachments/files/25147624/WinFormsApp1.zip)

### Diagnostics

```text

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.