high DPI problems

前端 未结 3 2060
忘了有多久
忘了有多久 2021-01-05 09:42

I have a problem with the display of our .NET Windows application under high dpi settings.

All forms are set to AutoScaleMode = DPI, but this does not solve all the

3条回答
  •  自闭症患者
    2021-01-05 10:15

    In theory, font and DPI scaling in Winforms are automatic. In practice... not so much.

    I've noticed that it copes better with vertical scaling than horizontal, but even then it's far from perfect.

    In my experience, scaling is only reliable when you do one of two things:

    1. Don't use the designer at all. This is quite painful, but it does give you the requisite amount of control over your layout.

    2. Use the built-in layout controls - specifically, the FlowLayoutPanel and TableLayoutPanel. These guys are your best friends; I rarely do anything in Winforms without them anymore.

    In your case, I'd probably go with #2. Based on the screen capture, I think it would be quite easy to fit your layout into a combination of TableLayoutPanel and FlowLayoutPanel containers - possibly even just one TableLayoutPanel.

提交回复
热议问题