且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows窗体和高DPI屏幕

更新时间:2023-12-06 16:41:16

我最终通过稍微重新设计表单以使其在所有屏幕上正确呈现来解决了该问题.另外有帮助

I eventually solved it by re-designing the forms slightly so that they render correctly on all screens. In addition following helped

  1. 将各个控件分组到容器中,例如组框和面板.
  2. 在每个父容器中正确使用控件的Anchor属性,以便它们在其父容器中缩放.
  3. 将父窗体的AutoScaleMode设置为Dpi,将AutoSizeMode设置为GrowAndShrink

我能够跨表格重复执行上述3个步骤,并可靠地对其进行更改,使其可以在高DPI"和常规屏幕上正常工作

I was able to follow the above 3 steps repeatedly across forms and change them reliably to work on both High DPI and regular screens