I can get the virtual screen size from System.Windows.SystemParameters, but since WPF doesn't work in pixels but in DPI-units I can't directly use this. How do I make my WPF window (Border=none) cover exactly the entire virtual screen ?
Asked
Active
Viewed 1,098 times
1 Answers
1
I did this and it worked fine:
public MainWindow()
{
InitializeComponent();
this.WindowStyle = System.Windows.WindowStyle.None;
this.Height = SystemParameters.VirtualScreenHeight;
this.Width = SystemParameters.VirtualScreenWidth;
this.Left = 0;
this.Top = 0;
}
Is this what you were thinking (but didn't post)?
private void Window_Loaded(object sender, RoutedEventArgs e)
{
this.WindowStyle = System.Windows.WindowStyle.None;
this.Left = 0;
this.Top = 0;
Point screenPoint = new Point(SystemParameters.VirtualScreenWidth, SystemParameters.VirtualScreenHeight);
Point translatedPoint = this.PointFromScreen(screenPoint);
this.Height = translatedPoint.Y;
this.Width = translatedPoint.X;
}

RQDQ
- 15,461
- 2
- 32
- 59
-
1Keep in mind that the Virtual Desktop is not necessarily rectangular. – Mike Caron Apr 23 '12 at 20:39