Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make full screen mode, without covering the taskbar using :wpf c#

I need to change windows taskbar in my WPF application. For that I set WindowStyle="None", which means to disable the windows taskbar, and make custom taskbar with buttons for restoring, minimizing and closing the application. Now my problem is if the application is in maximize mode then I can't see the start menu on windows.

I found a similar question here, but when I tried this code it didn't compile. full screen mode, but don't cover the taskbar

How can I create my own taskbar and able to see the windows start menu when I maximized it? Is there a property window in xaml which can set it?

like image 963
Evgeni Velikov Avatar asked Jan 26 '16 08:01

Evgeni Velikov


People also ask

How do I open a WPF window in 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 minimize a window in WPF?

Use the window's object WindowState property to programmaticly minimise a window. window. WindowState = WindowState.


2 Answers

You may try this:

MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;
like image 68
5 revs, 4 users 77%SuperG Avatar answered Oct 23 '22 22:10

5 revs, 4 users 77%SuperG


Found a solution on CodeProject which may help: http://www.codeproject.com/Articles/107994/Taskbar-with-Window-Maximized-and-WindowState-to-N

WindowStyle="None"
WindowState="Maximized"
ResizeMode="NoResize"

and

this.Width = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width;
this.Height = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;
this.Left = 0;
this.Top = 0;
this.WindowState = WindowState.Normal;
like image 38
M. Schena Avatar answered Oct 23 '22 20:10

M. Schena