Home > other >  Unwanted resizing of forms in C#
Unwanted resizing of forms in C#

Time:12-31

I'm and a friend are working on a training project. My friend's laptop monitor is full HD and my monitor is HD.

This difference in resolution has caused the project to change its size when it is transferred back to my system when it is transferred from my system to my friend's system.

To be clear, we are working on Visual Studio and suppose we have a form 1080 by 720 which in my system is OK when we edit the form. But when we save the project and move that on my friend's system to continue the project, because the monitor has a higher resolution, the size of the form becomes 1124 by 812, and this disrupts the whole design work.

The point is that the forms that we do not open on my friend's system remain in the same dimensions of 1080 by 720 and there is no change in them.

What is the way to solve this problem?

Thanks a lot

CodePudding user response:

Under the Layout section of your Form's properties set the AutoScaleMode to None.

Alternatively, if your AutoScaleMode is currently set to Font (the typical setting), then make sure that your system fonts are the same size.

CodePudding user response:

What you need is responsive design. if you design your program responsive, so every element of your app in any resolution load correctly.

I suggest reading this link to figure out how to do that

Dynamically Resizing Controls On Windows Forms

  • Related