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

最佳答案

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/

10-13 03:29