本文介绍了最大化WPF窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我是WPF应用程序开发的新手,开发的第一天就遇到了一个问题,问题是我的表单仅在水平方向最大化,而不在垂直方向最大化,我已经尽力了,但是仍然没有任何进展.有人可以帮我解决这里的问题吗?

以下是我正在尝试以编程方式实现的目标. (显然是单击最大化按钮)
(mw是"MainWindow"的名称.).

Hello,
I am new to WPF Application development and got a problem right on the first day of development, the problem is that my form is maximizing only horizontally and not vertically, i''ve tried what i knew but still there is no progress. Can anyone help me with a work around here?

Below is the thing that i am trying to achieve programmatically. (Obviously on click of maximize button)
(mw is the name of "MainWindow").

mw.WindowState = WindowState.Maximized;



我已经尝试过此行下的代码,但没有任何进展



i''ve tried the code below this line but no progress

mw.MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;

推荐答案


这篇关于最大化WPF窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 16:09