简体   繁体   English

在C#中设计全屏应用程序的最佳方法是什么?

[英]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.

相关问题 在C#应用程序中使用LINQ to SQL的最佳实践方法是什么? [设计模式] - What is the best-practice way to use LINQ to SQL in a C# application? [Design-pattern] 在c#中获取被调用可执行文件的完整路径和文件名的最佳方法是什么? - What's the best way to get the full path and filename of the invoked executable in c#? 全屏C#应用程序 - Full screen C# Application 在大型 c# 应用程序上进行批量命名空间重命名的最佳方法是什么? - What's the best way to do a bulk namespace rename on a large c# application? 在C#中创建具有多个屏幕的Windows Mobile应用程序的最佳方法是什么? - What's the best way to create a Windows Mobile application with multiple screens in C# c#-保留Windows窗体应用程序事件日志的最佳方法是什么? - c# - What's the best way to keep log for events of windows form application? 从 C# 应用程序加载 CSX 脚本的最佳方法是什么? - What's the best way to load a CSX script from a C# application? 在C#Web应用程序中实现通知的最佳方法是什么? - What is the best way to implement notification in a C# web application? 存储/设置C#应用程序配置设置的最佳方法是什么? - What is the best way to store/set configuration settings for a C# application? 在 C# 和 sql 中管理应用程序用户选项的最佳方法是什么? - what is the best way to manage application user options in C# and sql?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM