如何隐藏工具栏右侧的箭头? [英] How to hide arrow on right side of a Toolbar?
本文介绍了如何隐藏工具栏右侧的箭头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
想出了如何隐藏左侧的抓地力点,现在如何隐藏右侧的添加/删除按钮下拉箭头?
Figured out how to hide the grippy dots on the left side, now how do I hide that add/remove buttons drop-down arrow on the right side?
推荐答案
Google 给出了完整的答案:
Google is full with the answer to this:
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 事件.
And assign this method to your toolbar Loaded event.
这篇关于如何隐藏工具栏右侧的箭头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文