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 :  * 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.

傳回的介面trueTranslateAccelerator將不會呼叫OnMnemonicAn 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.

適用於

另請參閱