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

Dim e As KeyEventArgs Me.OnKeyUp(e)

イベントが発生すると、デリゲートを使用してイベント ハンドラが呼び出されます。詳細については、「イベントの発生」を参照してください。
OnKeyUp メソッドを使用すると、デリゲートを結び付けずに、派生クラスでイベントを処理することもできます。派生クラスでイベントを処理する場合は、この手法をお勧めします。
継承時の注意 派生クラスで OnKeyUp をオーバーライドする場合は、登録されているデリゲートがイベントを受け取ることができるように、基本クラスの OnKeyUp メソッドを呼び出してください。
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.OnKeyUp メソッドを検索する場合は、下記のリンクをクリックしてください。

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