通过


CheckBox.OnKeyDown(KeyEventArgs) 方法

定义

响应 CheckBoxKeyDown 事件。

protected:
 override void OnKeyDown(System::Windows::Input::KeyEventArgs ^ e);
protected override void OnKeyDown(System.Windows.Input.KeyEventArgs e);
override this.OnKeyDown : System.Windows.Input.KeyEventArgs -> unit
Protected Overrides Sub OnKeyDown (e As KeyEventArgs)

参数

e
KeyEventArgs

KeyEventArgs包含事件数据的项。

注解

此实现通过将事件数据true的属性设置为Handled在用户按下加号或减号键时将事件标记为KeyDown已处理。

此方法设置为IsCheckedtrue当用户按下加号键和false用户按下减号键时。

继承者说明

如果重写 OnKeyDown(KeyEventArgs),请始终在实现中 OnKeyDown(KeyEventArgs) 调用基本实现。 未能调用基实现会阻止基类使用类处理程序处理事件,这可能会更改最终类的运行时行为。 可以根据要求在特殊处理之前或之后调用基本实现。

适用于