DataGridView.RowHeaderMouseDoubleClick Ereignis

Definition

Tritt auf, wenn auf eine Zeilenüberschrift doppelklicken wird.

public:
 event System::Windows::Forms::DataGridViewCellMouseEventHandler ^ RowHeaderMouseDoubleClick;
public event System.Windows.Forms.DataGridViewCellMouseEventHandler RowHeaderMouseDoubleClick;
public event System.Windows.Forms.DataGridViewCellMouseEventHandler? RowHeaderMouseDoubleClick;
member this.RowHeaderMouseDoubleClick : System.Windows.Forms.DataGridViewCellMouseEventHandler 
Public Custom Event RowHeaderMouseDoubleClick As DataGridViewCellMouseEventHandler 

Ereignistyp

Beispiele

Im folgenden Codebeispiel wird die Verwendung dieses Elements veranschaulicht. Im Beispiel meldet ein Ereignishandler das Auftreten des RowHeaderMouseDoubleClick 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 DataGridView namens DataGridView1enthält. Stellen Sie dann sicher, dass der Ereignishandler dem RowHeaderMouseDoubleClick Ereignis zugeordnet ist.

private void DataGridView1_RowHeaderMouseDoubleClick(Object sender, DataGridViewCellMouseEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "ColumnIndex", e.ColumnIndex );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "RowIndex", e.RowIndex );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Button", e.Button );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Clicks", e.Clicks );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "X", e.X );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Y", e.Y );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Delta", e.Delta );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Location", e.Location );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "RowHeaderMouseDoubleClick Event" );
}
Private Sub DataGridView1_RowHeaderMouseDoubleClick(sender as Object, e as DataGridViewCellMouseEventArgs) _ 
     Handles DataGridView1.RowHeaderMouseDoubleClick

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "ColumnIndex", e.ColumnIndex)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "RowIndex", e.RowIndex)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Button", e.Button)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Clicks", e.Clicks)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "X", e.X)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Y", e.Y)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Delta", e.Delta)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Location", e.Location)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"RowHeaderMouseDoubleClick Event")

End Sub

Hinweise

Weitere Informationen zum Behandeln von Ereignissen finden Sie unter Behandeln und Auslösen von Ereignissen.

Gilt für:

Weitere Informationen