winfwu

导航

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;//屏幕高度
}

posted on 2013-01-21 17:39  winfwu  阅读(1080)  评论(0编辑  收藏  举报