独立于分辨率或独立于监视器大小的 WPF 应用程序 [英] Resolution independent or monitor size independent WPF apps

查看:54
本文介绍了独立于分辨率或独立于监视器大小的 WPF 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何开发独立于分辨率和独立于显示器大小的 wpf 应用程序.显示器大小独立在这里意味着假设我在 15 英寸显示器中开发了一个 wpf 应用程序,当我将在 17 英寸显示器中查看该应用程序时,UI 通常看起来不同,所以我如何摆脱 WPF 中的这个问题.请详细指导.谢谢

how could i develop resolution independent and monitor size independent wpf apps. monitor size independent means here suppose i develop a wpf apps in 15inch monitor and when i will view that apps in 17 inch monitor then often UI looks different so how could i get rid of this problem in WPF. please guide in detail. thanks

推荐答案

您正在寻找的是 WPF 中的 Liquid Layout.

What you are looking for is Liquid Layout in WPF.

避免为您的元素明确指定WidthHeight,它应该放大到任何可用的屏幕分辨率.

Avoid specifying explicit Width and Height for your elements and it should scale up to whatever screen resolution available.

当然,MinWidthMaxWidth 和 MinHeight、MaxHeight 在限制大小方面也很有用.

Of course, MinWidth, MaxWidth and MinHeight, MaxHeight are also useful in restricting the size.

这篇关于独立于分辨率或独立于监视器大小的 WPF 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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