Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide arrow on right side of a Toolbar?

Tags:

wpf

xaml

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?

like image 729
mpen Avatar asked Jan 11 '11 20:01

mpen


People also ask

What is the little up arrow on the taskbar called?

Overflow. A small upwards facing arrow will sit in the taskbar, close to a collection of other icons in the bottom-right of your screen. Clicking it will show other applications that are running in the background.

How do I change the right side of my taskbar?

Change the Size of the TaskbarRight-click the taskbar and turn off the “Lock the taskbar” option. Then place your mouse at the top edge of the taskbar and drag to resize it just like you would with a window.


1 Answers

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);
    }
}

And assign this method to your toolbar Loaded event.

like image 175
Andrei Pana Avatar answered Sep 21 '22 00:09

Andrei Pana