WPF的图形用户界面,改变大小的窗口? [英] WPF Gui that changes size with window?

查看:165
本文介绍了WPF的图形用户界面,改变大小的窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人对如何创建一个图形用户界面,可以改变大小的窗口大小的建议。类似的媒体中心是如何工作的。如果媒体中心最大化的字体等增加的大小。所以鬼始终是统一?

Does anybody have a suggestion on how to create a gui that can change size with the size of the window. Similar to how Media Center works. If media center is maximized the fonts etc increase in size. So the gui is always "uniform"?

推荐答案

您将需要视框作为最外层的容器,如果你想要的一切,包括字体和图像来调整。默认情况下,视框的Stretch属性设置为统一的,这意味着一切都保持一个相对高宽比和填充,将第一个剪辑时的方向。

You'll need a Viewbox as your outermost container if you want everything including fonts and images to resize. By default the Stretch property of the Viewbox is set to Uniform which means everything maintains a relative aspect ratio and fills the direction that would clip it first.

下面是从MSDN显示各种拉伸值的影响的一个例子。

Here's an example from MSDN displaying the effects of the various Stretch values.

这篇关于WPF的图形用户界面,改变大小的窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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