Form.ProcessCmdKey(Message, Keys) Form.ProcessCmdKey(Message, Keys) Form.ProcessCmdKey(Message, Keys) Form.ProcessCmdKey(Message, Keys) Method

定义

处理命令键。Processes a command key.

protected:
 override bool ProcessCmdKey(System::Windows::Forms::Message % msg, System::Windows::Forms::Keys keyData);
protected override bool ProcessCmdKey (ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData);
override this.ProcessCmdKey : Message * System.Windows.Forms.Keys -> bool
Protected Overrides Function ProcessCmdKey (ByRef msg As Message, keyData As Keys) As Boolean

参数

msg
Message Message Message Message

通过引用传递的 Message,它表示要处理的 Win32 消息。A Message, passed by reference, that represents the Win32 message to process.

keyData
Keys Keys Keys Keys

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

返回

如果控件处理并使用击键,则为 true;否则为 false,以允许进一步处理。true if the keystroke was processed and consumed by the control; otherwise, false to allow further processing.

注解

ProcessCmdKey方法重写基The ProcessCmdKey method overrides the base

ContainerControl.ProcessCmdKey实现,以提供对主菜单命令键和 MDI 快捷键的其他处理。ContainerControl.ProcessCmdKey implementation to provide additional handling of main menu command keys and MDI accelerators.

有关陷印击键的信息,请参阅 Microsoft 支持部门网站中的 "如何使用视觉C#对象在控件中补漏白击键" 和 "如何通过使用 Visual Basic .net 在 .net 控件中补漏白击键"。For information about trapping keystrokes, see How to trap keystrokes in controls by using Visual C# and How to trap keystrokes in .NET controls by using Visual Basic .NET in the Microsoft Support website.

适用于

另请参阅