使用 VB.NET WinForms 动态缩放 UI? [英] Dynamically Scaled UIs with VB.NET WinForms?

查看:26
本文介绍了使用 VB.NET WinForms 动态缩放 UI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人熟悉设计可扩展到任何分辨率的 UI.是否有任何 .NET 库或功能使这变得容易?我们还将基础设施控制作为一种资源.

I'm wondering if anyone is familiar with designing UIs to be scalable to any resolution. Are there any libraries or functionalities of .NET that make this easy? We also have Infragistics controls as a resource.

推荐答案

对于 Windows 窗体,最好的选择是使用动态生成的布局控件,并确保使用控件的 Anchor/Dock 属性进行放置,而不是明确定位和大小.

With Windows Forms, the best option is to use the dynamically generated layout controls, and make sure to use the Anchor/Dock properties of controls for placement, instead of positioning and sizing explicitly.

布局面板,例如 TableLayoutPanel,也有很大帮助,因为它们会在运行时动态调整大小.

The layout panels, such as TableLayoutPanel, also help tremendously, since they do dynamic resizing at runtime.

话虽如此,这是 WPF 比 Windows 窗体具有巨大优势的地方.在 WPF 中,所有大小和布局都是通过像素"完成的,像素"是一个虚拟化的、分辨率独立的像素",对应于 1/96 英寸.这意味着您的 UI 可以在任何分辨率下工作,前提是您没有明确地将其搞砸.

That being said, this is one place where WPF has a huge advantage over Windows Forms. In WPF, all sizing and layout is done with a "pixel" being a virtualized, resolution indepdent "pixel" which corresponds to 1/96th inch. This means your UI will just work on any resolution, provided you don't explicitly mess it up.

这篇关于使用 VB.NET WinForms 动态缩放 UI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆