When using the WinForms constructor, do I always need to set DPI to 96?

On my current monitor, I prefer a DPI setting of 120 pixels per inch (which Windows offers by default). However, after designing a form, it often goes wrong on systems that do not use 120 pixels per inch.

I am wondering if I need to set the display settings to 96 ppi whenever I use a designer?

In addition, there are some problems when other developers have different DPIs. They open the form in the designer and move something like a control for editing text, and suddenly find that it also automatically resizes. Then there is one control that is different in size from the others, and we are in a mess.

PS I read similar posts. They are all interesting, but did not answer my question.

How to control DPI font in .NET WinForms application

C # WinForms disable DPI scaling

WinForms Various DPI Layouts

DPI does not scale properly

Visual Studio and DPI Problem

+7
source share
2 answers

No. When using the WinForms designer, it is not necessary to always set the DPI to 96.

If you set the AutoScaleMode property to Dpi, the designer writes the current system Dpi to the designer.cs file in the AutoScaleDimensions property for the form. When a designer is used in a system with a different Dpi, this information will be used to change the scale of the form, and a designer can be used with another Dpi.

, . "None" , , "Font", -, , Dpi , , .

, , , AutoScaleMode Inherit. Dpi, .


, :

Windows Forms

:

http://kbalertz.com/967578/Child-controls-UserControl-clipped-system-lower.aspx

+5

, . , dpi , , , dpi.

, , dpis , . , , , .

+1

All Articles