如何制作全屏模式,而不使用以下任务栏覆盖任务栏:wpf c#

Evg*_*kov 10 c# wpf xaml taskbar startmenu

我需要在WPF应用程序中更改Windows任务栏.为此我设置WindowStyle="None",这意味着禁用Windows任务栏,并使用按钮进行自定义任务栏以恢复,最小化和关闭应用程序.现在我的问题是如果应用程序处于最大化模式,那么我无法在Windows上看到开始菜单.

我在这里找到了一个类似的问题,但是当我尝试这个代码时它没有编译.全屏模式,但不要覆盖任务栏

如何创建自己的任务栏并在最大化时能够看到Windows开始菜单?xaml中是否有可以设置的属性窗口?

Pik*_*koh 19

你可以试试这个:

MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;
Run Code Online (Sandbox Code Playgroud)


小智 8

您可以通过添加以下内容轻松地在 XAML 中添加高度约束:

MaxHeight="{Binding Source={x:Static SystemParameters.MaximizedPrimaryScreenHeight}}"
Run Code Online (Sandbox Code Playgroud)

进入窗口的标签。


M. *_*ena 5

在 CodeProject 上找到了一个可能有帮助的解决方案:http : //www.codeproject.com/Articles/107994/Taskbar-with-Window-Maximized-and-WindowState-to-N

WindowStyle="None"
WindowState="Maximized"
ResizeMode="NoResize"
Run Code Online (Sandbox Code Playgroud)

和

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;
Run Code Online (Sandbox Code Playgroud)