WPF Menuitem Border WPF Menuitem Border wpf wpf

WPF Menuitem Border


For a lot of the built-in WPF control styles, you need to override the ControlTemplate.

Here is the MSDN page that provides the Menu ControlTemplate, with instructions on how to use it -- basically you are inserting local copies of all the styles for the Menu control, which then override the default control look and feel.

To address your problem you should be able to just insert this style:

<Style x:Key="{x:Type Menu}" TargetType="{x:Type Menu}">  <Setter Property="OverridesDefaultStyle" Value="True"/>  <Setter Property="SnapsToDevicePixels" Value="True"/>  <Setter Property="Template">    <Setter.Value>      <ControlTemplate TargetType="{x:Type Menu}">        <!--Here is where you change the border thickness to zero on the menu-->        <Border BorderThickness="0">          <StackPanel ClipToBounds="True" Orientation="Horizontal"                      IsItemsHost="True"/>        </Border>      </ControlTemplate>    </Setter.Value>  </Setter></Style>