3

I am working on an application that has a full screen mode. When the full screen button/key is pressed the application should take up the entire screen i.e. the windows taskbar also disappears.

this.Window= WindowState.Maximized;
this.Window= WindowStyle.None;
this.Fullscreen = true;

When I first start the application my fullscreen mode works as planned and the windows taskbar disappears. The problem is when I resize the window. After any resizing the full screen mode no longer takes up the entire screen. The windows taskbar is still there. It is not reasonable for me to disable window resizing (although that does solve the problem).

It was my understanding that WindowStyle.None removed the taskbar (it does at first). Does anyone know if resizing the window changes something that stops the WindowStyle.None from doing what it does upon first starting up.

EDIT: I am using a viewbox to scale my content to fullscreen and the stretch of the viewbox in full screen mode is set to Fill

Joseph Devlin
  • 1,754
  • 1
  • 26
  • 37
  • Post a small repro? Or at least the relevant snippets of code for both going full-screen (already posted I see) and reverting back again (should be the opposite but want to be sure). – Kent Boogaart Jun 10 '11 at 11:15

2 Answers2

2

Try applying the WindowStyle first (before WindowState). That fixed it for me.

Edit: I also noticed that this doesn't work when the window is already maximized. Try this:

this.WindowState = WindowState.Normal;
this.WindowStyle = WindowStyle.None;
this.WindowState = WindowState.Maximized;
Botz3000
  • 39,020
  • 8
  • 103
  • 127
0

Instead of using WindowState use SystemParameters

In your Window's constructor set the width and height

this.Width=SystemParameters.FullPrimaryScreenWidth;
this.Height=SystemParameters.FullPrimaryScreenHeight;


You can also have a look here

Navid Rahmani
  • 7,848
  • 9
  • 39
  • 57