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.

備註

在訊息前置處理期間,會呼叫這個方法來處理對話方塊字元,例如 TAB、RETURN、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方法, false如果控制項沒有父系,則會傳回。 ProcessDialogKeyThe 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 Forms 應用程式或 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列舉: UIPermissionWindow的值。Associated enumeration: AllWindows value of UIPermissionWindow.

適用於