MenuItem.IsHighlighted Propriété
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient une valeur qui indique si un MenuItem est mis en surbrillance.
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
true
si un MenuItem est mis en surbrillance ; sinon, false
. La valeur par défaut est false
.
- Attributs
L’exemple suivant montre comment déterminer si un élément de menu est mis en surbrillance.
private void Highlight(object sender, RoutedEventArgs e)
{
if (item1.IsHighlighted == true)
{
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
À compter de la .NET Framework version 3.0 Service Pack 1, la IsHighlighted propriété a un setter protégé. Pour utiliser cette fonctionnalité, votre application doit cibler la .NET Framework version 3.5. Pour plus d’informations, consultez Versions et dépendances du .NET Framework.
Champ d’identificateur | IsHighlightedProperty |
Propriétés de métadonnées définies sur true |
Aucun |
Produit | 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 |
Windows Desktop | 3.0, 3.1, 5, 6, 7 |