Control.ProcessMnemonic メソッド
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim charCode As Char Dim returnValue As Boolean returnValue = Me.ProcessMnemonic(charCode)
戻り値
文字がコントロールによってニーモニックとして処理された場合は true。それ以外の場合は false。

このメソッドは、ニーモニック文字を処理する機会をコントロールに与えるために呼び出されます。このメソッドは、コントロールがニーモニックを処理する状態にあるかどうか、また、与えられた文字がニーモニックを表しているかどうかを判断します。この場合、このメソッドはニーモニックに関連付けられたアクションを実行し、true を返します。それ以外の場合、メソッドは false を返します。このメソッドの実装では、多くの場合において IsMnemonic メソッドを使用して、指定された文字がコントロールのテキスト内のニーモニックと一致するかどうかを判断します。
if (CanSelect && IsMnemonic(charCode, MyControl.Text) { // Perform action associated with mnemonic. }
ProcessMnemonic メソッドのこの既定の実装では、コントロールにニーモニックがないことを示すために、単に false を返します。

ProcessMnemonic メソッドをオーバーライドするボタン クラスを拡張し、カスタム動作を示す方法を次のコード例に示します。また、この例では、CanSelect プロパティと IsMnemonic プロパティも使用しています。この例を実行するには、次のコードを、同じファイル内のフォーム クラスの後に貼り付けます。そして、MnemonicButton 型のボタンをフォームに追加します。
// This button is a simple extension of the button class that overrides // the ProcessMnemonic method. If the mnemonic is correctly entered, // the message box will appear and the click event will be raised. // This method makes sure the control is selectable and the // mnemonic is correct before displaying the message box // and triggering the click event. public ref class MyMnemonicButton: public Button { protected: bool ProcessMnemonic( char inputChar ) { if ( CanSelect && IsMnemonic( inputChar, this->Text ) ) { MessageBox::Show( "You've raised the click event " "using the mnemonic." ); this->PerformClick(); return true; } return false; } };


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からControl.ProcessMnemonic メソッドを検索する場合は、下記のリンクをクリックしてください。

- Control.ProcessMnemonic メソッドのページへのリンク