gpt4 book ai didi

c# - 编辑 float 窗口关闭按钮

转载 作者:太空宇宙 更新时间:2023-11-03 15:33:10 24 4
gpt4 key购买 nike

我想知道是否可以在 wpf 中更改 float 窗口上的关闭按钮?我目前拥有它,就像一个关闭的窗口,带有白色十字和红色背景。我还有一个黑色十字的图像,想知道是否可以去掉红色背景和白色十字并用我的图像替换它?

    <syncfusion:DockingManager x:Name="DockingManager"
PersistState="True"
UseDocumentContainer="True"
Margin="0,0,0,0"
syncfusion:SkinManager.ActiveColorScheme="#E7E7E7"
HeaderForeground="Black"
SelectedHeaderBackground="{DynamicResource selectedHeaderBackground}"
syncfusion:DockingManager.DesiredHeightInFloatingMode="27"
syncfusion:DockingManager.DesiredHeightInDockedMode="27"
FloatWindowMouseOverHeaderBackground="#F6CD1D"
FloatWindowHeaderBackground="#F6CD1D"
HeaderForegroundSelected="Black"
TabItemBackgroundSelected="{DynamicResource headerBackground}"
TabPanelBackground="#FFE7E7E7"
SidePanelBackground="White"
TabItemsForeground="{DynamicResource {x:Static SystemColors.ActiveCaptionTextBrushKey}}"
Background="White"
FloatWindowHeaderForeground="{DynamicResource headerBackground}"
TabItemsBackground="{DynamicResource headerBackground}"
FloatWindowSelectedHeaderForeground="{DynamicResource headerBackground}"
FloatWindowMouseOverHeaderForeground="{DynamicResource headerBackground}"
HeaderBorderBrush="{x:Null}"
OpacityMask="{DynamicResource headerBackground}"
TabItemsBorderBrush="{DynamicResource headerBackground}"
FloatWindowSelectedHeaderBackground="{DynamicResource headerBackground}"
HeaderBackground="{DynamicResource headerBackground}"
TabItemForegroundSelected="#FF4A515A">
<syncfusion:DockingManager.SideItemsBorderBrush>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FFEFEEEE" Offset="0"/>
<GradientStop Color="#E7000000"/>
</LinearGradientBrush>
</syncfusion:DockingManager.SideItemsBorderBrush>
<dockWindow:LocationMap x:Name="Locationmap"
syncfusion:DockingManager.DesiredHeightInDockedMode="100"
Background="White"
syncfusion:DockingManager.SideInDockedMode="Left"
syncfusion:DockingManager.State="Dock"
syncfusion:DockingManager.DesiredWidthInDockedMode="300" FontWeight="Bold" FontSize="10.667">
<syncfusion:DockingManager.HeaderTemplate>
<DataTemplate>
<DockPanel>
<Image Source="Images/dragger.png" Height="20" Width="5" HorizontalAlignment="Left"/>
<Image Source="Images/Earth.png" Height="15" Width="15" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock Text="Location Map" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="2"/>
</DockPanel>
</DataTemplate>
</syncfusion:DockingManager.HeaderTemplate>
<dockWindow:LocationMap.Foreground>
<ImageBrush />
</dockWindow:LocationMap.Foreground>
</dockWindow:LocationMap>
<dockWindow:Tornado x:Name="TornadoDiagram"
syncfusion:DockingManager.SideInDockedMode="Right"
syncfusion:DockingManager.State="Dock"
syncfusion:DockingManager.DesiredWidthInDockedMode="400"
syncfusion:DockingManager.DesiredHeightInDockedMode="200" FontWeight="Bold">
<syncfusion:DockingManager.HeaderTemplate>
<DataTemplate>
<DockPanel>
<Image Source="Images/dragger.png" Height="20" Width="5" HorizontalAlignment="Left"/>
<Image Source="Images/Tornado1.png" Height="15" Width="15" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock Text="Tornado Diagram" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="2"/>
</DockPanel>
</DataTemplate>
</syncfusion:DockingManager.HeaderTemplate>
</dockWindow:Tornado>
<dockWindow:Cdf x:Name="CdfDiagram"
syncfusion:DockingManager.SideInDockedMode="Bottom"
syncfusion:DockingManager.State="Dock"
syncfusion:DockingManager.TargetNameInDockedMode="TornadoDiagram"
syncfusion:DockingManager.DesiredWidthInDockedMode="400"
syncfusion:DockingManager.DesiredHeightInDockedMode="200" FontWeight="Bold" >
<syncfusion:DockingManager.HeaderTemplate>
<DataTemplate>
<DockPanel>
<Image Source="Images/dragger.png" Height="20" Width="5" HorizontalAlignment="Left" Margin="1"/>
<Image Source="Images/CDF1.png" Height="15" Width="15" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="1"/>
<TextBlock Text="CDF" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2"/>
<Image Source="Images/dragger.png" Height="20" Width="5" HorizontalAlignment="Right" Margin="1"/>
</DockPanel>
</DataTemplate>
</syncfusion:DockingManager.HeaderTemplate>
</dockWindow:Cdf>

最佳答案

因此,最好的方法是自己创建自定义窗口,这样您就可以完全按照自己的意愿创建窗口。它比在 XAML 中简单更改一件事要长一些,但它有效

关于c# - 编辑 float 窗口关闭按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32993967/

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