ToolStrip.ProcessDialogKey(Keys) ToolStrip.ProcessDialogKey(Keys) ToolStrip.ProcessDialogKey(Keys) ToolStrip.ProcessDialogKey(Keys) Method

定義

處理對話方塊按鍵。Processes a dialog box key.

protected:
 override bool ProcessDialogKey(System::Windows::Forms::Keys keyData);
protected override bool ProcessDialogKey (System.Windows.Forms.Keys keyData);
override this.ProcessDialogKey : System.Windows.Forms.Keys -> bool
Protected Overrides 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.

備註

ProcessDialogKey在處理對話方塊字元,例如 TAB、 RETURN、 逸出,和方向鍵前置處理的訊息呼叫方法。The ProcessDialogKey method is called during message preprocessing to handle dialog characters such as TAB, RETURN, ESCAPE, 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 control's ProcessDialogKey method, or returns false if the control has no parent. System.Windows.Forms.Form類別會覆寫此方法以執行實際處理對話方塊按鍵。The System.Windows.Forms.Form class overrides this method to perform actual processing of dialog box keys. 當控制項裝載在 Windows Forms 應用程式或 ActiveX 控制項中時,只會呼叫這個方法。This method is only called when the control is hosted in a Windows Forms application or 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.

適用於