dotnet / dotnet/winforms

Incorrect scaling of MDI child forms

Open
#11,815 7 comments 0 reactions 2 assignees Claimed by @LeafShi1 View on GitHub
area-HDPI area-MDI
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

### .NET version

.net 8.0, 9.0 Preview6

### Did it work in .NET Framework?

Yes

### Did it work in any of the earlier releases of .NET Core or .NET 5+?

No

### Issue description

The MDI child form for auto-scaling is using the current font of the MDI parent form instead of default application font. When an MDI child form is shown, it uses the font of its parent but doesn't perform auto-scaling. A possible workaround would be to set the form font in the constructor.

### Steps to reproduce

1. Change font size of the MDI parent form
2. Don't set the font of the MDI child form
3. Open MDI child form
4. Notice the incorrect scaling of controls on the child form.

[TestMDIAudoScaling.zip](https://github.com/user-attachments/files/16499712/TestMDIAudoScaling.zip)

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.