KeyEventArgs.IsUp 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取一个值,该值指示事件引用的键是否处于启动状态。
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 返回指定的值是否已启动。