Transparent toolbar and overflow area
-
Hi everybody, I tried to have a transparent toolbar (Background="Transparent") but the overflow area (this thingy with a button that you can drag the toolbar from - don't know it's technical name :) ) stayed. Does anybody know how to make it be transparent without the need of a new control template which requires me to build everything from scratch? I know i won't have any overflow items and the toolbar is fixed (can't be drag) i will appreciate a clue :) Yanai
-
Hi everybody, I tried to have a transparent toolbar (Background="Transparent") but the overflow area (this thingy with a button that you can drag the toolbar from - don't know it's technical name :) ) stayed. Does anybody know how to make it be transparent without the need of a new control template which requires me to build everything from scratch? I know i won't have any overflow items and the toolbar is fixed (can't be drag) i will appreciate a clue :) Yanai
If you just want to hide the drag area of the ToolBar you could put it inside a ToolBarTray and set the ToolBarTray.IsLocked property to "True", if you also want to hide the overflow area you will need to define a new style for the ToolBar, for example:
<Style x:Key="{x:Type ToolBar}" TargetType="{x:Type ToolBar}"> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToolBar}"> <Border CornerRadius="2" BorderThickness="1" Background="Transparent" BorderBrush="Black"> <ToolBarPanel IsItemsHost="true" Margin="0,1,2,2"/> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style>code>
-
If you just want to hide the drag area of the ToolBar you could put it inside a ToolBarTray and set the ToolBarTray.IsLocked property to "True", if you also want to hide the overflow area you will need to define a new style for the ToolBar, for example:
<Style x:Key="{x:Type ToolBar}" TargetType="{x:Type ToolBar}"> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToolBar}"> <Border CornerRadius="2" BorderThickness="1" Background="Transparent" BorderBrush="Black"> <ToolBarPanel IsItemsHost="true" Margin="0,1,2,2"/> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style>code>