Modifier

Partager via


MenuItem.IsHighlighted Property

Definition

Gets a value that indicates whether a MenuItem is highlighted.

public:  property bool IsHighlighted {  public:
bool get(); protected:
 void set(bool value); };
[System.ComponentModel.Browsable(false)]
public bool IsHighlighted { get; protected set; }
[<System.ComponentModel.Browsable(false)>]
member this.IsHighlighted : bool with get, set
Public Property IsHighlighted As Boolean

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.

private void Highlight(object sender, RoutedEventArgs e)
{
    if (item1.IsHighlighted)
    {
        hlbtn.Content = "Item is highlighted.";
    }
}
Private Sub Highlight(ByVal sender As Object, ByVal e As RoutedEventArgs)
    If item1.IsHighlighted = True Then
        hlbtn.Content = "Item is highlighted."
    End If
End Sub

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