-1

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 ?

Pygmy
  • 1,268
  • 17
  • 33
  • 1
    Can you show the code that you have so far (e.g. the code that is geting the size of the virtual screen, etc)? – RQDQ Apr 23 '12 at 20:21

1 Answers1

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