PropertyGrid.KeyUp Ereignis

Definition

Tritt auf, wenn eine Taste losgelassen wird, während das Steuerelement den Fokus hat.

public:
 event System::Windows::Forms::KeyEventHandler ^ KeyUp;
[System.ComponentModel.Browsable(false)]
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 

Ereignistyp

Attribute

Beispiele

Im folgenden Codebeispiel wird die Verwendung dieses Elements veranschaulicht. Im Beispiel meldet ein Ereignishandler das Auftreten des KeyUp Ereignisses. Dieser Bericht hilft Ihnen, zu erfahren, wann das Ereignis auftritt und Sie beim Debuggen unterstützen kann. Wenn Sie über mehrere Ereignisse oder ereignisse berichten möchten, die häufig auftreten, erwägen Sie, die Nachricht durch MessageBox.Show eine mehrteilige Console.WriteLineNachricht zu ersetzen TextBox oder sie anzufügen.

Um den Beispielcode auszuführen, fügen Sie ihn in ein Projekt ein, das eine Instanz des Typs PropertyGrid namens PropertyGrid1enthält. Stellen Sie dann sicher, dass der Ereignishandler dem KeyUp Ereignis zugeordnet ist.

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

Hinweise

Weitere Informationen zur Behandlung von Ereignissen finden Sie unter behandeln und Auslösen von Ereignissen.

Gilt für: