SplitContainer.ProcessDialogKey(Keys) SplitContainer.ProcessDialogKey(Keys) SplitContainer.ProcessDialogKey(Keys) SplitContainer.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.

備註

這個方法是在訊息前置處理期間呼叫,以處理對話方塊索引鍵字元,例如 TAB、向左鍵、向右箭號、向上鍵和向下鍵。This method is called during message preprocessing to handle dialog box key characters, such as TAB, LEFT ARROW, RIGHT ARROW, UP ARROW, and DOWN ARROW. 不會處理包含 ALT 或 CONTROL 修飾詞的索引鍵。Keys that include the ALT or CONTROL modifiers are not handled. 只有當Control.IsInputKey方法指出控制項不是處理索引鍵時,才會呼叫這個方法。This method is called only if the Control.IsInputKey method indicates that the control is not processing the key. 只會將字元傳送至父系的Control.ProcessDialogKey方法, false如果控制項沒有父系,則會傳回。 Control.ProcessDialogKeyThe Control.ProcessDialogKey simply sends the character to the parent's Control.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 控制項時,執行時間才會呼叫這個方法。The run time calls this method only 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. 相關聯的列舉:AllWindowsAssociated enumeration: AllWindows

適用於

另請參閱