gpt4 book ai didi

WPF:如何删除 DocumentViewer 中的搜索框?

转载 作者:行者123 更新时间:2023-12-04 00:03:16 24 4
gpt4 key购买 nike

我的 XAML 代码是这样的:

<Window
xmlns ='http://schemas.microsoft.com/netfx/2007/xaml/presentation'
xmlns:x ='http://schemas.microsoft.com/winfx/2006/xaml'
Title ='Print Preview - More stuff here'
Height ='200'
Width ='300'
WindowStartupLocation ='CenterOwner'>
<DocumentViewer Name='dv1' ... />
</Window>

如何在 XAML 或 C# 中消除搜索框?

最佳答案

您可以执行类似于 Cheeso's answer 的操作与 ContentControl 的风格以及当名称为 PART_FindToolBarHost 时隐藏它的触发器.

<DocumentViewer>
<DocumentViewer.Resources>
<Style TargetType="ContentControl">
<Style.Triggers>
<Trigger Property="Name" Value="PART_FindToolBarHost">
<Setter Property="Visibility" Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</DocumentViewer.Resources>
</DocumentViewer>

关于WPF:如何删除 DocumentViewer 中的搜索框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2322727/

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