且构网

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

如何根据c#.net windows应用程序中的系统分辨率设置窗体分辨率?

更新时间:2021-12-14 21:44:25

申请表格有没有决议。表单占据了屏幕的一部分。如果调整表单大小会改变控件的比例,那将是一团糟。所以你需要做的是考虑布局而不是控件的位置。 WPF为您提供了更好的工具,但在Windows窗体中,您有一些不可能性:

停靠 [ ^ ], autsizing [ ^ ]和主播 [ ^ ]

流程布局 [ ^ ]和表格布局 [ ^ ]

当然你可以设置窗口位置[ ^ ]到,自动 [ ^ ]如果需要。
The application forms have no resolution. The form takes a portion of the screen. It would be a mess if resizing a form would change the scale of the controls. So what you need do do is to think in layout and not in position of the controls. WPF is giving you better tools, but in windows forms you have some impossibilities:
Docking[^], autsizing[^] and anchors[^]
Flow layout[^] and Table layout[^]
But of course you can set window position[^] to, automatically[^] if you need.


使用表布局面板等容器,简单面板等根据要求将控件放入内部

学习 dock,Anchor cntrols的属性



快乐编码!

:)
use contaners like table layout panel , simple panels etc. put controls inside as per requirement
learn dock, Anchor properties of cntrols

Happy Coding!
:)