IKeyboardInputSink.OnMnemonic(MSG, ModifierKeys) 方法

定义

调用此接收器的助记键(访问键)之一时调用。

C#
[System.Security.SecurityCritical]
public bool OnMnemonic(ref System.Windows.Interop.MSG msg, System.Windows.Input.ModifierKeys modifiers);
C#
public bool OnMnemonic(ref System.Windows.Interop.MSG msg, System.Windows.Input.ModifierKeys modifiers);

参数

msg
MSG

助记键和关联数据的消息。 请勿修改此消息结构。 仅由于性能原因,通过引用来传递此消息。

modifiers
ModifierKeys

修改键。

返回

如果消息已处理,则为 true;否则为 false

属性

注解

Microsoft Windows 消息必须是WM_CHAR、WM_SYSCHAR、WM_DEADCHAR或WM_SYSDEADCHAR。

如果组件包含组件,则必须通过调用每个包含组件的 OnMnemonic 方法在实现中传递消息。

从 返回的true接口不会调用 OnMnemonicTranslateAccelerator 实现可以选择在 中 TranslateChar执行所有特定的组合键处理,并绕过 OnMnemonic

适用于

产品 版本
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

另请参阅