ToolStripLabel.ProcessMnemonic(Char) 方法

定义

处理助记键字符。Processes a mnemonic character.

protected public:
 override bool ProcessMnemonic(char charCode);
protected internal override bool ProcessMnemonic (char charCode);
override this.ProcessMnemonic : char -> bool
Protected Friend Overrides Function ProcessMnemonic (charCode As Char) As Boolean

参数

charCode
Char

要处理的字符。The character to process.

返回

如果字符由控件作为助记键处理,则为 true;否则为 falsetrue if the character was processed as a mnemonic by the control; otherwise, false.

注解

调用此方法可使项有机会处理助记键字符。This method is called to give an item the opportunity to process a mnemonic character. 方法应确定项是否处于用于处理助记键的状态, 以及给定字符是否表示助记键。The method should determine whether the item is in a state to process mnemonics and if whether the given character represents a mnemonic. 如果是这样, 则该方法应执行与助记键关联的操作true, 并返回。If so, the method should perform the action associated with the mnemonic and return true. 如果不是, 则该方法false应返回。If not, the method should return false.

实现依赖于宿主ToolStrip控件来调用IsMnemonic方法, 以确定给定字符是否与项文本中的助记键匹配。 ToolStripLabelThe ToolStripLabel implementation relies on the host ToolStrip control to call the IsMnemonic method to determine whether the given character matches a mnemonic in the item's text. 在这种情况下, 方法将选择与标签关联的项, 或者在Click无法选择项时引发事件。In this case, the method selects the item associated with the label, or raises the Click event if the item cannot be selected.

安全性

UIPermission
用于继承类的所有窗口以调用此方法。for all windows for inheriting classes to call this method. 关联的AllWindows UIPermissionWindow枚举: 值。Associated enumeration: AllWindows value of UIPermissionWindow.

适用于