Share via

Weird problem with a Winforms application and Windows 10 scaling

Gian-9139 11 Reputation points
2022-06-15T12:46:06.657+00:00

Hi guys,
I have a really simple Winforms application written in C# with VS Professional 2022 (64-bit) version 17.2.4 and .NET Core 6.0.

It's a form that contains a tab control that contains a table layout panel that contains a listbox.
Every child control is set to anchor to Top, Bottom, Left, Right.
The expected behaviour is, when I resize the form, every child control resizes accordingly.
But this is true only if I scale Windows 10 to 100%. If I switch to 125% the children controls go crazy.

This is the form at 100% scaling
211712-image.png

And this is the same form at 125% scaling
211639-image.png

You can download the testing project from here https://1drv.ms/u/s!Aoz_1Yt8KEEpiRQDuNHrNClhPt7g?e=JrU7Tw

Developer technologies | .NET | .NET Runtime

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.