gpt4 book ai didi

wpf - 如何隐藏工具栏右侧的箭头?

转载 作者:行者123 更新时间:2023-12-03 21:14:11 24 4
gpt4 key购买 nike

想出如何隐藏左侧的棘手点,现在如何隐藏右侧的添加/删除按钮下拉箭头?

最佳答案

Google对此充满了答案:

private void ToolBar_Loaded(object sender, RoutedEventArgs e)
{
ToolBar toolBar = sender as ToolBar;
var overflowGrid = toolBar.Template.FindName("OverflowGrid", toolBar) as FrameworkElement;
if (overflowGrid != null)
{
overflowGrid.Visibility = Visibility.Collapsed;
}

var mainPanelBorder = toolBar.Template.FindName("MainPanelBorder", toolBar) as FrameworkElement;
if (mainPanelBorder != null)
{
mainPanelBorder.Margin = new Thickness(0);
}
}


并将此方法分配给工具栏的Loaded事件。

关于wpf - 如何隐藏工具栏右侧的箭头?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4662428/

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