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

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,185 questions
{count} votes

Your answer

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