KeyEventArgs.IsDown Propriété
Définition
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 la clé référencée par l’événement est dans l’état down.
public:
property bool IsDown { bool get(); };
public bool IsDown { get; }
member this.IsDown : bool
Public ReadOnly Property IsDown As Boolean
Valeur de propriété
true si la clé est en panne ; sinon, false.
Exemples
L’exemple suivant vérifie si la clé associée à une instance d’est KeyEventArgs en panne en obtenant l’état de la IsDown propriété.
// e is an instance of KeyEventArgs.
// btnIsDown is a Button.
if (e.IsDown)
{
btnIsDown.Background = Brushes.Red;
}
' e is an instance of KeyEventArgs.
' btnIsDown is a Button.
If e.IsDown Then
btnIsDown.Background = Brushes.Red
Remarques
La Keyboard classe fournit également des informations sur l’état des touches du clavier. Par exemple, la IsKeyDown méthode retourne si une clé spécifiée est en panne.