Quick Tip: Fullscreen Window in WPF
(aka Windows Presentation Foundation aka Avalon aka XAML)
C#:
-
WindowState = WindowState.Normal;
-
WindowStyle = WindowStyle.None;
-
Topmost = true;
-
WindowState = WindowState.Maximized;
That's it, nice and easy. Setting WindowState to normal before and then maximized after fixed an issue where it was fullscreen, but didn't expand to cover the taskbar.
I did this in order to make a patch for Big Visible Cruise, a new app that displays CruiseControl.net statuses in a big noticeable window. (Issue 14)
I got some ideas from this forum post on the MSDN forums.
Big Visible Cruise is hosted on Google Code. I'd never used it before, but it was really easy and simple to log in, add a comment, and attach a patch.
[...] Re: Covering entire screen in WPF applications Have you set all the properties listed bellow ? http://blog.vorpal.cc/category/devel…ow-in-wpf.html — Patrice "Norton" <Norton> a écrit dans le message de groupe de discussion : 1365D414-71F4-4834-9EA3-BB6BA1F005A5… > Hello, > I have a WPF application and, based on certain configuration, it needs to > cover the entire screen, including the taskbar. It is easy to do by > setting > WindowState to Maximized. The problem occurs when some message box from > another application pops up, then the taskbar becomes visible. For > example, > if I execute "net send" to my computer, and click somewhere on the message > box, the taskbar shows up. > I was wondering if there is an easy way to handle this case, or this would > require handling WM_PAINT notifications in my own WindowProc handler? > > I would appreciate any help on this! > > Thanks, > Norton. [...]
Thank you for your post but I have a problem when using this:
When I switch to fullscreen mode, there are 2px from right and bottom of the screen uncovered! I checked my window size when maximized, and it was ok (1280×800 as my screen is), but Left and Top value of the window are -7 and -7, and I cant change it! what can I do?
thanks
Try adding these properties to your window, worked for me!
AllowsTransparency=”True” Background=”Transparent”