KeyEventArgs.IsDown Proprietà

Definizione

Ottiene un valore che indica se il tasto cui fa riferimento l'evento è nello stato premuto.

public:
 property bool IsDown { bool get(); };
public bool IsDown { get; }
member this.IsDown : bool
Public ReadOnly Property IsDown As Boolean

Valore della proprietà

true se il tasto è premuto; in caso contrario, false.

Esempio

Nell'esempio seguente viene verificato se la chiave associata a un'istanza di KeyEventArgs è inattiva ottenendo lo stato della IsDown proprietà .

// 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

Commenti

La Keyboard classe fornisce anche informazioni sullo stato dei tasti sulla tastiera. Ad esempio, il IsKeyDown metodo restituisce se una chiave specificata è inattiva.

Si applica a

Vedi anche