KeyEventArgs.IsDown 속성

정의

이벤트에서 참조하는 키가 눌러져 있는지 여부를 나타내는 값을 가져옵니다.

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

속성 값

키가 눌러져 있으면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 의 instance KeyEventArgs 연결된 키가 속성의 IsDown 상태를 가져와서 다운되었는지 여부를 확인합니다.

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

설명

클래스는 Keyboard 키보드의 키 상태에 대한 정보도 제공합니다. instance 경우 메서드는 IsKeyDown 지정된 키가 다운되었는지 여부를 반환합니다.

적용 대상

추가 정보