Control.KeyUp イベント
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

public: event KeyEventHandler^ KeyUp { void add (KeyEventHandler^ value); void remove (KeyEventHandler^ value); }

-
KeyDown
-
KeyPress
-
KeyUp
キーボード イベントをフォームでだけ処理し、そのイベントを他のコントロールでは受け取らないようにする場合は、フォームの KeyPress イベント処理メソッドの KeyPressEventArgs.Handled プロパティを true に設定します。Tab キー、Enter キー、Esc キー、方向キーなどは、コントロールによって自動処理されます。これらのキーで KeyUp イベントを発生させるには、フォーム上の各コントロールで IsInputKey メソッドをオーバーライドする必要があります。IsInputKey のオーバーライドのコードは、特殊なキーのいずれかが押され、そのキーが true の値を返したかどうかを判断する必要があります。

KeyUp イベントと Help クラスを使用して、ポップアップ スタイルのヘルプをユーザーに表示するコード例を次に示します。
' This example demonstrates how to use the KeyUp event with the Help class to display ' pop-up style help to the user of the application. When the user presses F1, the Help ' class displays a pop-up window, similar to a ToolTip, near the control. This example assumes ' that a TextBox control, named textBox1, has been added to the form and its KeyUp ' event has been contected to this event handler method. Private Sub textBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles textBox1.KeyUp ' Determine whether the key entered is the F1 key. Display help if it is. If e.KeyCode = Keys.F1 Then ' Display a pop-up help topic to assist the user. Help.ShowPopup(textBox1, "Enter your first name", New Point(textBox1.Right, Me.textBox1.Bottom)) End If End Sub 'textBox1_KeyUp
// This example demonstrates how to use the KeyUp event with the Help class to display // pop-up style help to the user of the application. When the user presses F1, the Help // class displays a pop-up window, similar to a ToolTip, near the control. This example assumes // that a TextBox control, named textBox1, has been added to the form and its KeyUp // event has been contected to this event handler method. private void textBox1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { // Determine whether the key entered is the F1 key. Display help if it is. if(e.KeyCode == Keys.F1) { // Display a pop-up help topic to assist the user. Help.ShowPopup(textBox1, "Enter your first name", new Point(textBox1.Right, this.textBox1.Bottom)); } }
// This example demonstrates how to use the KeyUp event with the Help class to display // pop-up style help to the user of the application. When the user presses F1, the Help // class displays a pop-up window, similar to a ToolTip, near the control. This example assumes // that a TextBox control, named textBox1, has been added to the form and its KeyUp // event has been connected to this event handler method. private: void textBox1_KeyUp( Object^ /*sender*/, System::Windows::Forms::KeyEventArgs^ e ) { // Determine whether the key entered is the F1 key. Display help if it is. if ( e->KeyCode == Keys::F1 ) { // Display a pop-up help topic to assist the user. Help::ShowPopup( textBox1, "Enter your first name", Point(textBox1->Right,this->textBox1->Bottom) ); } }
// This example demonstrates how to use the KeyUp event with the Help // class to display pop-up style help to the user of the application. // When the user presses F1, the Help class displays a pop-up window, // similar to a ToolTip, near the control. This example assumes that a // TextBox control, named textBox1, has been added to the form and its // KeyUp event has been contected to this event handler method. private void textBox1_KeyUp(Object sender, System.Windows.Forms.KeyEventArgs e) { // Determine whether the key entered is the F1 key. // Display help if it is. if (e.get_KeyCode().Equals(Keys.F1)) { // Display a pop-up help topic to assist the user. Help.ShowPopup(textBox1, "Enter your first name", new Point(textBox1.get_Right(), this.textBox1.get_Bottom())); } } //textBox1_KeyUp

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.KeyUp イベントを検索する場合は、下記のリンクをクリックしてください。

- Control.KeyUp イベントのページへのリンク