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

定义

处理命令键。Processes a command key.

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

参数

m
Message Message Message Message

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

keyData
Keys Keys Keys Keys

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

返回

在所有情况下均为 falsefalse in all cases.

注解

在消息预处理过程中调用此方法来处理命令键。This method is called during message preprocessing to handle command keys. 命令键是始终优先于常规输入键的键。Command keys are keys that always take precedence over regular input keys. 命令键的示例包括快捷键和菜单快捷方式。Examples of command keys include accelerators and menu shortcuts. 方法必须返回true以指示它已处理命令键, 或false指示该密钥不是命令键。The method must return true to indicate that it has processed the command key, or false to indicate that the key is not a command key.

DropDown如果ToolStripDropDownItem 集合中DropDownItems存在项, 则ProcessCmdKey此方法的实现将调用的。The ToolStripDropDownItem implementation of this method calls the ProcessCmdKey of the DropDown if there are items in the DropDownItems collection. 否则, 此实现将调用基类实现。Otherwise, this implementation calls the base class implementation.

继承者说明

当在派生ProcessCmdKey(Message, Keys)类中重写方法时, 方法重写应true返回以指示它已处理该键。When overriding the ProcessCmdKey(Message, Keys) method in a derived class, the method override should return true to indicate that it has processed the key. 派生类很少需要重写此方法 (如果需要)。Derived classes will seldom, if ever, need to override this method.

安全性

SecurityPermission
适用于直接调用方和继承类来调用此方法。for the immediate caller and inheriting classes to call this method. 关联的枚举UnmanagedCode:。Associated enumeration: UnmanagedCode.

适用于