如何在WPF中设置窗口的分辨率 [英] How to set resolution for a window in WPF
本文介绍了如何在WPF中设置窗口的分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HI,
我想为我的wpf窗口设置分辨率..我如何使用它..jus为我提供xaml或C#中的任何信息..
例如,如果我创建300x300像素的窗口,但是运行应用程序时.它应该可以在1024x768或1152x864等环境下工作....因此请提供一些信息..
i want to set the resolution for my wpf window..how can i use it..jus provide me any info abt tis either in xaml or C#..
For instance if i create my window in 300x300 pixel but when i run my appli. it should work in 1024x768 or 1152x864 etc....so pls provide some info..
推荐答案
在窗口的构造函数中,设置Width
并Height
属性:
In your window''s constructor, set theWidth
andHeight
properties:
this.Width = 1024;
this.Height = 768;
或者,在设计器中,只需设置适当的值即可.
OR, in the designer, just set the appropriate values.
这篇关于如何在WPF中设置窗口的分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文