DataGridView.CellContentDoubleClick Olay

Tanım

Kullanıcı bir hücrenin içeriğine çift tıkladığında gerçekleşir.

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

Olay Türü

Örnekler

Aşağıdaki kod örneğinde bu üyenin kullanımı gösterilmektedir. Örnekte, bir olay işleyicisi olayın oluşumunu CellContentDoubleClick raporlar. Bu rapor, olayın ne zaman gerçekleştiğini öğrenmenize yardımcı olur ve hata ayıklamada size yardımcı olabilir. Birden çok olayı veya sık gerçekleşen olayları raporlamak için, iletisini ile Console.WriteLine değiştirmeyi MessageBox.Show veya çok satırlı TextBoxbir iletiye eklemeyi göz önünde bulundurun.

Örnek kodu çalıştırmak için, adlı DataGridView1bir tür DataGridView örneği içeren bir projeye yapıştırın. Ardından olay işleyicisinin olayla ilişkilendirildiğinden CellContentDoubleClick emin olun.

private void DataGridView1_CellContentDoubleClick(Object sender, DataGridViewCellEventArgs 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();
MessageBox.Show(messageBoxCS.ToString(), "CellContentDoubleClick Event" );
}
Private Sub DataGridView1_CellContentDoubleClick(sender as Object, e as DataGridViewCellEventArgs) _ 
     Handles DataGridView1.CellContentDoubleClick

    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()
    MessageBox.Show(messageBoxVB.ToString(),"CellContentDoubleClick Event")

End Sub

Açıklamalar

Olayları işleme hakkında daha fazla bilgi için bkz. Olayları İşleme ve Oluşturma.

Şunlara uygulanır

Ayrıca bkz.