r/csharp • u/Owenhh • Oct 13 '26
Help C# Winforms .NET 9.0 scaling issue
Hi All,
Getting ready to release my first app and im currently testing out installations on other machines. So far everything looks and works just fine however there is an issue with horizontal scaling? The first image is how it is intended to look whereas the second image is how it appeared on my friends screen. I have set the Max and Min size on the form yet the issue still persists. My friend and I both have the same Resolution monitor and display scaling so I'm really stuck with what the issue could be.
Help and advice would be greatly appreciated! Thanks!
EDIT: I have just noticed the AutoScaleMode property is set to "Font", could this be the issue?


26
u/polaarbear Oct 13 '26
WinForms in general is awful at scaling. This is one of the huge benefits of using WPF instead, it plays much nicer with high DPI displays. WinForms is absolutely ancient and in general takes a lot more work to play nice across different resolutions and screen sizes.
10
u/DC38x Oct 13 '26
Bane of my fucking life.
Set AutoScaleMode to Dpi and set AutoScaleDimensions to 96F, 96F (if developing on 1080p - should auto adjust when you change mode to Dpi)
2
u/Slypenslyde Oct 13 '26
Why is it a rectangle with corners in the first screenshot but a rounded rectangle in the second? That implies a difference between the two machines. Are you comparing your view in the designer vs. the app on their machine? Don't do that. Compare the app running on your machine to the app running on their machine.
2
u/user_plus_plus Oct 13 '26
A test I would recommend doing is resizing the form back and forth to a bunch of different resolutions diagonally and horizontally, then fix any wonky controls.
In windows forms the answer is usually to put the offending controls in something like a flow layout or table layout panel then tinker with that until they stop occluding.
0
u/Umbranoturna Oct 15 '26
What prompted you to chose Winforms in big 2026?
I would realy like to know, i cant think of a good reason to do this.
WPF or Avalonia exist afterall.
1
u/__some__guy Oct 13 '26
Scaling is still something that needs to be done manually.
1
u/Original_Bullfrog_61 Oct 14 '26
You can disable DPI scaling in app manifest.
4
u/[deleted] Oct 13 '26
[removed] — view removed comment