我需要在我的软件上添加一个不同于前一个分辨率的新显示器,但我仍然需要支持两者。
我在考虑在每个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 selectThe 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.
更多推荐
发布评论