MenuItem.IsHighlighted Property

Definition

Gets a value that indicates whether a MenuItem is highlighted.

C#
[System.ComponentModel.Browsable(false)]
public bool IsHighlighted { get; protected set; }

Property Value

true if a MenuItem is highlighted; otherwise, false. The default is false.

Attributes

Examples

The following example shows how to determine whether a menu item is highlighted.

C#
private void Highlight(object sender, RoutedEventArgs e)
{
    if (item1.IsHighlighted)
    {
        hlbtn.Content = "Item is highlighted.";
    }
}

Remarks

Starting with the .NET Framework version 3.0 Service Pack 1, the IsHighlighted property has a protected setter. To use this functionality, your application should target the .NET Framework version 3.5. For more information, see .NET Framework Versions and Dependencies.

Dependency Property Information

Item Value
Identifier field IsHighlightedProperty
Metadata properties set to true None

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10