Form Looks Different on Another Computer

c#, visual-studio-2010, winforms

Solution

Either the font or the DPI differ.

And I've never really found a way to say `AutoScaleMode = (most appropriate of font or dpi)`.

But try `AutoScaleMode = DPI` and `AutoScaleMode = Font`. One of them should work.

We never found a reliable way to handle this. Our workplace USED to enforce the DPI on all workstations, but that has since changed. The best way to handle it is to make sure you layout your controls with FlowLayoutPanel or TableLayoutPanels instead of absolute positioning of controls.

Problem

When I build my form on my machine it looks fine, but when it is compiled on a different computer the size of the form itself is wrong. Labels are moved around and things are no longer aligned properly. How do I guarantee that everything will look the same on any computer? I tried setting `AutoScaleMode` to none, and it helped a bit but then the labels were partially underneath the corresponding text boxes.

Original source

Related problems