WPF ToolBar: how to remove grip and overflow

后端 未结 6 2405
有刺的猬
有刺的猬 2020-12-07 14:29

In a nested WPF ToolBarPanel-ToolBar-Menu we want to get rid of the grip handle to the left and the overflow area to the right. they are both grayed out, but we\'d like them

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-07 15:07

    You can use Blend to rather simply override the ControlTemplate for the ToolBarPanel, Menu, or ToolBar.

    1. Right click on the ToolBar and select Edit Template
    2. From Edit Template, select Edit a Copy
    3. I recommend adding the copy to a Resource Dictionary
    4. Click Ok

    You'll now be editing the control template for the ToolBarPanel, and can set the visibility to Collapsed for the grip and overflow signal. You can rinse and repeat for the other controls. It is a bit time consuming, but isn't terribly hard with Blend.

提交回复
热议问题