How to remove the "button" effect for a menu item (WPF)

Posted by Sorin Comanescu on Stack Overflow See other posts from Stack Overflow or by Sorin Comanescu
Published on 2010-04-15T06:56:24Z Indexed on 2010/04/15 7:13 UTC
Read the original article Hit count: 288

Filed under:

Hi,

When the mouse is over a menu item (first level) it displays a 3D button effect. How can this be removed?

Thanks.

EDIT:

Tried

<Style TargetType="MenuItem">
    <Style.Triggers>
        <Trigger Property="IsMouseOver" Value="True">
            <Setter Property="BorderBrush" Value="Transparent">
            <Setter Property="BorderThickness" Value="0">
        </Trigger>
    </Style.Triggers>
</Style>

with no effect.

The menu XAML:

<Window x:Class="UCWPF.Window3"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:conv="clr-namespace:UCWPF.Converters"
    Title="Window3" Height="600" Width="600"
    Background="{StaticResource WindowBackgroundBrush}"
    >

<StackPanel Style="{StaticResource WindowContainerStyle}">
    <Menu>
        <MenuItem Header="New" Icon="{StaticResource ImageExport}" />
        <MenuItem Header="Open" Icon="{StaticResource ImageOpen}" />
        <MenuItem Header="Save" Icon="{StaticResource ImageSave}" />
        <MenuItem Header="Export" Icon="{StaticResource ImageExport}" />
    </Menu>
...

And here's the screenshot: bordereffect

© Stack Overflow or respective owner

Related posts about wpf