Make WPF application Fullscreen (Cover startmenu)

I would like to make my WPF application fullscreen. Right now, the Start menu does not allow you to cover everything and changes the application. 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"> 
+53
c # wpf
Aug 30 '10 at 22:34
source share
4 answers

You are probably missing 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"> 
+125
Aug 30 '10 at 22:39
source share
 <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"> 

The window state is Maximized, and the window style is None.

+6
Oct 27 '15 at 17:00
source share

You can also do this at runtime as follows:

  • Name the window (x: Name = "HomePage")
  • In the constructor, simply set the WindowState property for Maximized as follows

HomePage.WindowState = WindowState.Maximized;

+3
Apr 09 '13 at 7:15
source share
 window.WindowStyle = WindowStyle.None; window.ResizeMode = ResizeMode.NoResize; window.Left = 0; window.Top = 0; window.Width = SystemParameters.VirtualScreenWidth; window.Height = SystemParameters.VirtualScreenHeight; window.Topmost = true; 

Works with multiple screens

+1
Dec 16 '16 at 9:39
source share



All Articles