[英]What's the best way to design a full screen application in C#?
I want to know the best way to design a full screen form, like positioning controls in a way that they won't get messed up if the user's resolution is different. 我想知道设计全屏表单的最佳方法,例如以用户不会改变的分辨率摆弄控件的方式放置控件。
This is my fullscreen code: 这是我的全屏代码:
int w = Screen.PrimaryScreen.Bounds.Width;
int h = Screen.PrimaryScreen.Bounds.Height;
this.Location = new Point(0, 0);
this.Size = new Size(w, h);
Anchors and Docks. 锚和码头。
The Anchor will bind the control. 锚点将绑定控件。 The Dock property sets how it expands/shrinks. Dock属性设置其扩展/缩小的方式。
So if you assign a button anchor to "Top, left" it's size and position stay locked on those sides. 因此,如果您将按钮锚定分配给“顶部,左侧”,则其大小和位置将锁定在那些侧面。 So if you dragged the Form window wider, the object would expand to towards the right and towards the bottom. 因此,如果将“窗体”窗口拖动得更宽,则该对象将向右和向底部扩展。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.