Make my wpf application Full Screen (Cover taskbar and title bar of window)

34,427

Solution 1

Try this:

<Window ShowTitleBar="False" IgnoreTaskbarOnMaximize="True">

Solution 2

You need to set the WindowStyle to none as well as WindowState to Maximized

<Window ...    
 WindowStyle="None"   
 WindowState="Maximized">

Solution 3

You need to set the ResizeMode to NoResize and WindowState to Maximized

  <Window ...    
    ResizeMode="NoResize" WindowState="Maximized">

Solution 4

If the taskbar doesn't disappear, it may help to change the Window visibility before and after changing window style, like this:

    private void MainWindow_StateChanged(object sender, EventArgs e) {
        if (this.WindowState == WindowState.Maximized) {
            // hide the window before changing window style
            this.Visibility = Visibility.Collapsed;
            this.Topmost = true;
            this.WindowStyle = WindowStyle.None;
            this.ResizeMode = ResizeMode.NoResize;
            // re-show the window after changing style
            this.Visibility = Visibility.Visible;
        }
        else {
            this.Topmost = false;
            this.WindowStyle = WindowStyle.SingleBorderWindow;
            this.ResizeMode = ResizeMode.CanResize;
        }
    }

Solution 5

You just need to set the WindowStyle to none:

<Window ...
    WindowStyle="None">
Share:
34,427

Related videos on Youtube

Sowvik Roy
Author by

Sowvik Roy

Updated on July 05, 2022

Comments

  • Sowvik Roy
    Sowvik Roy almost 2 years

    I would like to make my application such that it can maximize to full screen means it hide the windows task bar and the title bar as well. And it should triggered by a button.

    I am trying to develop the my application window like this. enter image description here

    Add my code snippet below

     <controls:MetroWindow x:Class="EDUI.MainWindow"
                xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:local="clr-namespace:EDiscoveryCore;assembly=EDiscoveryCore"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                Title="eDi"  BorderBrush="SkyBlue" BorderThickness="2" Height="999" Width="1071" WindowState="Maximized" x:Name="MainWindows">
    
  • user1069816
    user1069816 almost 9 years
    To use IgnoreTaskbarOnMaximize you need to be using MahApps, see mahapps.com
  • Ian GM
    Ian GM almost 7 years
    ResizeMode="NoResize" was the missing piece for me with Windows 10 WPF. Thank you @Narek
  • T James
    T James almost 7 years
    Worked for me also. Thank you!
  • Milan Kocic
    Milan Kocic over 6 years
    This also was solution for WPF on windows 10. Without that it works fine on win 7 but not on win 8 and win 10. I am using WindowState="Maximized" WindowStyle="None" ResizeMode="NoResize"
  • lindexi
    lindexi almost 6 years
    ShowInTaskbar="False"
  • Nicolas
    Nicolas over 5 years
    I already had WindowStyle=None and WindowState=Maximized (in this order!) which worked in Windows 7 and Windows 8.1 without a problem. But as soon as my application opened a dialog window, the taskbar appeared topmost on Windows 10 - and it didn't went away, except when switching to a different window and back to my application. ResizeMode=NoResize solved this!
  • komodosp
    komodosp about 5 years
    Is ShowTitleBar a real property? It's giving me an error, and apparently the correct way of hiding the title bar is WindowStyle="None"
  • krobelusmeetsyndra
    krobelusmeetsyndra about 4 years
    That did it for me. Thanks a lot!!