PropertyGrid.KeyUp イベント

定義

コントロールにフォーカスがあるときにキーが離されたときに発生します。

public:
 event System::Windows::Forms::KeyEventHandler ^ KeyUp;
[System.ComponentModel.Browsable(false)]
public event System.Windows.Forms.KeyEventHandler KeyUp;
[<System.ComponentModel.Browsable(false)>]
member this.KeyUp : System.Windows.Forms.KeyEventHandler 
Public Custom Event KeyUp As KeyEventHandler 

イベントの種類

属性

次のコード例は、このメンバーの使用方法を示しています。 この例では、イベント ハンドラーは、 KeyUp イベントの発生を報告します。 このレポートは、イベントがいつ発生するかを学習するのに役立ち、デバッグに役立ちます。 複数のイベントや頻繁に発生するイベントについて報告するには、 MessageBox.ShowConsole.WriteLine に置き換えるか、メッセージを複数行の TextBoxに追加することを検討してください。

コード例を実行するには、PropertyGridという名前の型のインスタンスを含むプロジェクトPropertyGrid1貼り付けます。 次に、イベント ハンドラーが KeyUp イベントに関連付けられていることを確認します。

private void PropertyGrid1_KeyUp(Object sender, KeyEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Alt", e.Alt );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Control", e.Control );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Handled", e.Handled );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "KeyCode", e.KeyCode );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "KeyValue", e.KeyValue );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "KeyData", e.KeyData );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Modifiers", e.Modifiers );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Shift", e.Shift );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "SuppressKeyPress", e.SuppressKeyPress );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "KeyUp Event" );
}
Private Sub PropertyGrid1_KeyUp(sender as Object, e as KeyEventArgs) _ 
     Handles PropertyGrid1.KeyUp

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "Alt", e.Alt)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Control", e.Control)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Handled", e.Handled)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "KeyCode", e.KeyCode)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "KeyValue", e.KeyValue)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "KeyData", e.KeyData)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Modifiers", e.Modifiers)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Shift", e.Shift)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "SuppressKeyPress", e.SuppressKeyPress)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"KeyUp Event")

End Sub

注釈

イベントの処理の詳細については、「処理とイベントの発生」を参照してください。

適用対象