IKeyboardInputSink.OnMnemonic(MSG, ModifierKeys) IKeyboardInputSink.OnMnemonic(MSG, ModifierKeys) IKeyboardInputSink.OnMnemonic(MSG, ModifierKeys) IKeyboardInputSink.OnMnemonic(MSG, ModifierKeys) Method

定義

當叫用這個接收的其中一個助憶鍵 (便捷鍵 (Access Key)) 時呼叫。Called when one of the mnemonics (access keys) for this sink is invoked.

public:
 bool OnMnemonic(System::Windows::Interop::MSG % msg, System::Windows::Input::ModifierKeys modifiers);
[System.Security.SecurityCritical]
public bool OnMnemonic (ref System.Windows.Interop.MSG msg, System.Windows.Input.ModifierKeys modifiers);
abstract member OnMnemonic : MSG * System.Windows.Input.ModifierKeys -> bool
Public Function OnMnemonic (ByRef msg As MSG, modifiers As ModifierKeys) As Boolean

參數

msg
MSG MSG MSG MSG

助憶鍵及其相關聯資料的訊息。The message for the mnemonic and associated data. 請勿修改這個訊息結構。Do not modify this message structure. 參考僅基於效能考量而傳送它。It is passed by reference for performance reasons only.

modifiers
ModifierKeys ModifierKeys ModifierKeys ModifierKeys

輔助按鍵 (Modifier Key)。Modifier keys.

傳回

如果已處理訊息,則為 true;否則為 falsetrue if the message was handled; otherwise, false.

備註

Microsoft WindowsMicrosoft Windows訊息必須是 WM_CHAR、WM_SYSCHAR、WM_DEADCHAR 或 WM_SYSDEADCHAR。The Microsoft WindowsMicrosoft Windows message must be WM_CHAR, WM_SYSCHAR, WM_DEADCHAR or WM_SYSDEADCHAR.

如果元件包含元件,則訊息必須藉由呼叫每個包含元件的OnMnemonic方法,在您的執行中傳遞。If the component has contained components, the message must be passed in your implementation by calling each contained component's OnMnemonic method.

true OnMnemonic從傳回的介面不會呼叫TranslateAcceleratorAn interface that returns true from TranslateAccelerator will not call OnMnemonic. 可以選擇在中TranslateChar執行所有特定的按鍵組合處理。和略過。 OnMnemonicImplementations can choose to perform all specific key combination handling in TranslateChar.and bypass OnMnemonic.

適用於

另請參閱