Control.ProcessDialogKey(Keys) Control.ProcessDialogKey(Keys) Control.ProcessDialogKey(Keys) Control.ProcessDialogKey(Keys) Method

定义

处理对话框键。Processes a dialog key.

protected:
 virtual bool ProcessDialogKey(System::Windows::Forms::Keys keyData);
protected virtual bool ProcessDialogKey (System.Windows.Forms.Keys keyData);
abstract member ProcessDialogKey : System.Windows.Forms.Keys -> bool
override this.ProcessDialogKey : System.Windows.Forms.Keys -> bool
Protected Overridable Function ProcessDialogKey (keyData As Keys) As Boolean

参数

keyData
Keys Keys Keys Keys

Keys 值之一,表示要处理的键。One of the Keys values that represents the key to process.

返回

如果键已由控件处理,则为 true;否则为 falsetrue if the key was processed by the control; otherwise, false.

注解

消息处理对话框字符,如选项卡中,返回、 ESC、 和箭头键在预处理过程中调用此方法。This method is called during message preprocessing to handle dialog characters, such as TAB, RETURN, ESC, and arrow keys. 仅当调用此方法IsInputKey方法指示该控件未在处理该键。This method is called only if the IsInputKey method indicates that the control is not processing the key. ProcessDialogKey只需将字符发送到的父ProcessDialogKey方法或返回false如果控件具有没有父级。The ProcessDialogKey simply sends the character to the parent's ProcessDialogKey method, or returns false if the control has no parent. Form类重写此方法以执行实际处理对话框键。The Form class overrides this method to perform actual processing of dialog keys. 当控件承载在 Windows 窗体应用程序或作为 ActiveX 控件时,只能调用此方法。This method is only called when the control is hosted in a Windows Forms application or as an ActiveX control.

继承者说明

重写时ProcessDialogKey(Keys)派生类中的方法,控件应返回true以指示它已处理该键。When overriding the ProcessDialogKey(Keys) method in a derived class, a control should return true to indicate that it has processed the key. 不会处理由控件调用的基类的结果的密钥ProcessDialogChar(Char)方法应返回。For keys that are not processed by the control, the result of calling the base class's ProcessDialogChar(Char) method should be returned. 控件将很少,如果有过,需要重写此方法。Controls will seldom, if ever, need to override this method.

安全性

UIPermission
有关继承的类来调用此方法的所有窗口。for all windows for inheriting classes to call this method. 关联枚举:AllWindows的值UIPermissionWindowAssociated enumeration: AllWindows value of UIPermissionWindow.

适用于