Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make WPF Application Fullscreen (Cover startmenu)

Tags:

c#

wpf

I would like to make my WPF application fullscreen. Right now the start menu prevents it from covering everything and shifts my application up. This is what I have for my MainWindow.xaml code:

<Window x:Class="HTA.MainWindow"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     mc:Ignorable="d"      WindowStyle="None" ResizeMode="NoResize"     WindowStartupLocation="CenterScreen"      Width="1024" Height="768"> 
like image 676
Robert Avatar asked Aug 30 '10 22:08

Robert


People also ask

How do I make WPF window full screen?

Just set the WindowState to Maximized , and the WindowStyle to None . Also setting the Window as topmost will make sure no other Window shows up over your window.

How do I keep windows on top of WPF?

Basically, to keep it on top you just set the lose focus event to make it go back to top.

How do I change the content of a window in WPF?

You can put the content of the window into a UserControl. Your window then only has a content-control and a button to change the content. On a click on the button you can reassign the content-property of the content-control.


2 Answers

You're probably missing the WindowState="Maximized", try the following:

<Window x:Class="HTA.MainWindow"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="MainWindow" Height="350" Width="525"     WindowStyle="None" ResizeMode="NoResize"       WindowStartupLocation="CenterScreen" WindowState="Maximized"> 
like image 76
Nuno Ramiro Avatar answered Sep 24 '22 09:09

Nuno Ramiro


<Window x:Class="HTA.MainWindow"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     mc:Ignorable="d"      ResizeMode="NoResize"     WindowStartupLocation="CenterScreen"      Width="1024" Height="768"     WindowState="Maximized" WindowStyle="None"> 

Window state to Maximized and window style to None

like image 32
Jeba Ranganathan Avatar answered Sep 25 '22 09:09

Jeba Ranganathan