Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different AutoScaleDimensions leads to incorrect form representation

In my C# .NET 3.5 application I am using WinForms forms with docking and anchoring. I am working on a desktop with big display and on a small laptop.

A few forms has a list view with anchors set to both 4 bounds and a few buttons below.

My forms are shown incorrectly: if I edit a form on the desktop computer, on the notebook the lowest buttons will be not shown (will be cut by a container bounds) and I only see stretched list view. If I edit a form on the laptop, on the desktop computer it will not fill the container completely.

I found the reason - the form's AutoScaleDimensions differs for these two computers, on the desktop it is (8F, 16F) while on the laptop it is (6F, 13F). I am puzzled of how to make my GUI working on both?

like image 412
Alex Avatar asked Oct 14 '25 09:10

Alex


1 Answers

It seems I found the solution myself: the reason of incorrect behavior was that my user control and containing forms were designed on different computers so they scaling did not match. After I opened them all in a single computer and set user control's AutoScaleMode = AutoScaleMode.Inherit, it worked perfectly.

like image 185
Alex Avatar answered Oct 20 '25 03:10

Alex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!