AutoScale function does not work properly in .NET 8+
- 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.
3. Create inherited form -> InheritedForm : BaseForm.
4. Open InheritedForm in the designer, all buttons have bigger size
5. Open InheritedForm in runtime as dialog box from some main form, all buttons have smaller size.
Simple project example:
[WinFormsApp1.zip](https://github.com/user-attachments/files/25147624/WinFormsApp1.zip)
### Diagnostics
```text
```
Contributor guide
Assessment
This issue has not been assessed yet.