舒雨(Fashion)
不能被常识捆住手脚

Window程序如何全屏大家都知道:

  window.WindowState = WindowState.Maximized; 

  window.WindowStyle =WindowStyle.None;

  window.ResizeMode = ResizeMode.NoResize; 

  window.Topmost = true; 

  window.Left = 0.0; 

  window.Top = 0.0;  

  window.Width =SystemParameters.PrimaryScreenWidth;

  window.Height =SystemParameters.PrimaryScreenHeight;

但浏览器的page如何全屏呢??发现wpf有个NavigationWindow导航窗口,借助这个窗口可以实现window的全屏,在web程序中新建个window窗口,该web程序的App.xaml设置 StartupUri="Window1.xaml" (window1.xaml指窗口名称)启动window窗口,在window窗口中加入如下代码:

 private void Window_Loaded(object sender, RoutedEventArgs e)         {

 NavigationWindow window = new NavigationWindow();

 window.Source = new Uri("page.xaml", UriKind.Relative);//page.xaml为启动的page页面

 window.WindowState = WindowState.Maximized;

 window.WindowStyle = WindowStyle.None;

 window.ResizeMode =ResizeMode.NoResize;

 window.Topmost = true;

 window.Left = 0.0;

 window.Top = 0.0; 

 window.Width = SystemParameters.PrimaryScreenWidth;

 window.Height = SystemParameters.PrimaryScreenHeight;

 window.ShowInTaskbar = false;

 window.ShowsNavigationUI = false;

 window.Show();

 this.Close();

}

好了page全屏完成

NavigationWindow导航窗口的介绍http://www.cnblogs.com/jonet007/archive/2011/11/04/2236203.html

posted on 2011-11-04 14:52  舒雨  阅读(1556)  评论(0编辑  收藏  举报