如何在.Net上处理不同的屏幕分辨率(How to handle different screen resolutions on .Net)

编程入门 行业动态 更新时间:2024-10-18 10:34:07
如何在.Net上处理不同的屏幕分辨率(How to handle different screen resolutions on .Net)

我需要在我的软件上添加一个不同于前一个分辨率的新显示器,但我仍然需要支持两者。

我在考虑在每个FORM LOAD事件中包含一个开关盒,并根据屏幕分辨率,然后更改表格中包含的所有按钮,表单,对象的大小。

Select case Resolution case 800x480 resizes my controls... case 1024x768 resizes my controls... end select

该应用程序将在带有紧凑框架3.5的Windows CE 6上运行

问题是:

是否有更智能的方法来处理.NET中的不同分辨率?

I need to add on my software a new monitor with different resolution than previous one but I still need support for both.

I was thinking about include a switch case on every FORM LOAD event and, based on screen resolution, then change sizes of all buttons, forms, objects in general contained in the form.

Select case Resolution case 800x480 resizes my controls... case 1024x768 resizes my controls... end select

The application will run on windows ce 6 with compact framework 3.5

Question is:

Is there a smarter way to handle different resolutions in .NET?

最满意答案

是的,虽然这取决于您正在使用的用户界面框架。

目标是设计您的接口,以便在不同的分辨率下合理扩展。 这可以在Windows窗体中完成,例如,通过利用Anchor和Dock属性,而不是使用绝对定位和大小调整。 这允许项目在窗口大小改变时“移动”和“缩放”。

Yes, though it depends on which user interface framework you're using.

The goal is to design your interfaces to expand reasonably at different resolutions. This can be done in Windows Forms, for example, by taking advantage of the Anchor and Dock properties, instead of using absolute positioning and sizing. This allows the items to "move" and "scale" appropriate as the window sizes change.

更多推荐

本文发布于:2023-04-29 02:45:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1334508.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:屏幕分辨率   如何在   Net   resolutions   handle

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!