use*_*127 3 wpf xaml desktop-application c#-4.0
我有一个WPF窗口,如何设置WPF窗口大小是相对监视器屏幕的25%.如何设置这些属性.
Vya*_*yas 22
在您的MainWindow构造函数中添加
this.Height = (System.Windows.SystemParameters.PrimaryScreenHeight * 0.25);
this.Width = (System.Windows.SystemParameters.PrimaryScreenWidth * 0.25);
Run Code Online (Sandbox Code Playgroud)
也不要在MainWindows.xaml中设置WindowState ="Maximized",否则它将无效.希望这可以帮助.