WPF c#实现窗口全屏

1.xaml代码如下

在<window>中添加Loaded="Window_Loaded"

2.C#代码如下

private void Window_Loaded(object sender, RoutedEventArgs e)

{
// 设置全屏
this.WindowState = System.Windows.WindowState.Normal;
this.WindowStyle = System.Windows.WindowStyle.None;
this.ResizeMode = System.Windows.ResizeMode.NoResize;
this.Topmost = true;

this.Left = 0.0;
this.Top = 0.0;
this.Width = 1600;//屏幕宽度
this.Height = 900;//屏幕高度
}

原文地址:https://www.cnblogs.com/DeepBlues/p/2870167.html