KeyEventArgs.IsRepeat 屬性

定義

取得值,這個值指出事件參考的鍵盤按鍵是否為重複的按鍵。

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

屬性值

如果為重複按鍵,則為 true,否則為 false。 沒有任何預設值。

範例

下列範例會藉由取得 屬性的狀態,檢查與 實例 KeyEventArgs 相關聯的索引鍵是否為重複的 IsRepeat 索引鍵。

// e is an instance of KeyEventArgs.
// btnIsRepeat is a Button.
if (e.IsRepeat)
{
    btnIsRepeat.Background = Brushes.AliceBlue;
}
' e is an instance of KeyEventArgs.
' btnIsRepeat is a Button.
If e.IsRepeat Then
    btnIsRepeat.Background = Brushes.AliceBlue
End If

適用於

另請參閱