System.Windows.Forms.Control.ProcessMnemonic Method

Processes a mnemonic character.

Syntax

protected virtual bool ProcessMnemonic (char charCode)

Parameters

charCode
The character to process.

Returns

true if the character was processed as a mnemonic by the control; otherwise, false.

Remarks

This method is called to give a control the opportunity to process a mnemonic character. The method should determine whether the control is in a state to process mnemonics and if whether the given character represents a mnemonic. If so, the method should perform the action associated with the mnemonic and return true. If not, the method should return false. Implementations of this method often use the Control.IsMnemonic(char, string) method to determine whether the given character matches a mnemonic in the control's text.

For example:

Example

if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
      // Perform action associated with mnemonic.
       }

This default implementation of the Control.ProcessMnemonic(char) method simply returns false to indicate that the control has no mnemonic.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0