Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF : Maximize window with WindowState Problem (application will hide windows taskbar)

Tags:

I have set my main window state to "Maximized" but the problem is my application will fill the whole screen even task bar. what am i doing wrong ? I'm using windows 2008 R2 with resolution : 1600 * 900

Here is the Xaml :

<Window x:Class="RadinFarazJamAutomationSystem.wndMain"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:sys="clr-namespace:System;assembly=mscorlib"     xmlns:local="clr-namespace:RadinFarazJamAutomationSystem"      xmlns:mwt="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"     Title="MyName"  FontFamily="Tahoma" FontSize="12" Name="mainWindow"  WindowState="Maximized"   xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"     xmlns:my="clr-namespace:RadinFarazJamAutomationSystem.Calendare.UC" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  Loaded="mainWindow_Loaded" FlowDirection="LeftToRight"     ResizeMode="NoResize" Closed="mainWindow_Closed"> 
like image 751
Pouyan Avatar asked Jul 31 '11 15:07

Pouyan


People also ask

How do I hide the taskbar when Windows is maximized?

To auto-hide Windows 10 Taskbar, right-click on the Windows 10 Desktop and select the Personalize option. After selecting the Taskbar option from the left side pane and turn the toggle On next to “Automatically hide the taskbar in desktop mode.”

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 hide a window in WPF?

An alternative to H.B.'s method is just to set the Visibility to hidden and set ShowInTaskbar to false. This still creates the window and lets it do its thing.


1 Answers

You can set the MaxHeight property of that window to SystemParameters.MaximizedPrimaryScreenHeight using the constructor.

public MainWindow() {     InitializeComponent();     this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight; } 
like image 59
Yiğit Yener Avatar answered Sep 23 '22 06:09

Yiğit Yener