KeyEventArgs.IsUp 屬性

定義

取得值,這個值指出事件參考的按鍵是否為已釋放的狀態。

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

屬性值

如果按鍵為已釋放的狀態,則為 true,否則為 false。 沒有任何預設值。

範例

下列範例會藉由取得 屬性的狀態IsUp,檢查 與 實例KeyEventArgs相關聯的索引鍵是否已啟動。

// e is an instance of KeyEventArgs.
// btnIsUp is a Button.
if (e.IsUp)
{
    btnIsUp.Background = Brushes.Red;
}
' e is an instance of KeyEventArgs.
' btnIsUp is a Button.
If e.IsUp Then
    btnIsUp.Background = Brushes.Red

備註

類別 Keyboard 也會提供鍵盤上按鍵狀態的相關信息。 例如,方法會 IsKeyUp 傳回指定的 是否已啟動。

適用於

另請參閱