[wpf]wpf full screen.

void window_KeyDown(object sender,KeyEventArgs e)

{

    if(e.Key == Key.F11)

    {

        Window.ResizeMode = ResizeMode.NoResize;

        

        Window.WindowState = WindowState.Normal;

        Window.WindowStyle = WindowStyle.None;

        

        Window.Width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;

        Window.Height = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;

        Window.Top = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Top;

        Window.Left = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Left;

        

        Window.WindowState = WindowState.Maximized;

    }

}

void window_KeyDown(object sender,KeyEventArgs e)
  {
  if(e.Key == Key.F11)
  {
  Window.ResizeMode = ResizeMode.NoResize;
   
  Window.WindowState = WindowState.Normal;
  Window.WindowStyle = WindowStyle.None;
   
  Window.Width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
  Window.Height = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
  Window.Top = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Top;
  Window.Left = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Left;
   
  Window.WindowState = WindowState.Maximized;
  }
  }
原文地址:https://www.cnblogs.com/nocanstillbb/p/11251304.html