gpt4 book ai didi

wpf - 在全屏窗口上可见背景

转载 作者:行者123 更新时间:2023-12-04 14:35:28 24 4
gpt4 key购买 nike

当我单击全屏按钮时,我的 WPF 应用程序(带有 Elysium Extra )在窗口右侧有一个边距:

enter image description here

在右侧你可以看到我的桌面背景。

我检查了是否有边距,但它设置为 0 px在所有方面。
我也设置了

this.MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;
this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;

应用程序.xaml:
<extra:ElysiumApplication x:Class="CTS.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:extra="http://schemas.extra.com/ui"
xmlns:local="clr-namespace:CTS"
Theme="Dark"
StartupUri="MainWindow.xaml" />

MainWindow.xaml:
<extra:Window x:Class="CTS.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:extra="http://schemas.extra.com/ui"
xmlns:local="clr-namespace:CTS"
mc:Ignorable="d"
Title="..." Height="521.877" Width="1239.945" FontFamily="Open Sans" Foreground="#FF0970D1" Background="#FF22313F">

....

编辑:我已经检查了 Elysium Extra 演示应用程序。它也有同样的问题,所以看起来它是由框架引起的。但是,我想继续使用它。

我怎样才能摆脱这个 margin ?

最佳答案

看看这个:http://stackoverflow.com/a/24818071/4587181
它使用一些 Windows32 互操作来正确设置 Windows 边距。
因为当您使用自己的自定义窗口镶边(WindowStyle = None)时也会发生此问题,所以我经历过。这个 SO answer 解决了它。
祝你好运

关于wpf - 在全屏窗口上可见背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44719706/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com