Share via


DataGridViewCellStyleContentChangedEventArgs.CellStyleScope Özellik

Tanım

Değiştirilen hücre stilinden etkilenen kapsamı alır.

public:
 property System::Windows::Forms::DataGridViewCellStyleScopes CellStyleScope { System::Windows::Forms::DataGridViewCellStyleScopes get(); };
public System.Windows.Forms.DataGridViewCellStyleScopes CellStyleScope { get; }
member this.CellStyleScope : System.Windows.Forms.DataGridViewCellStyleScopes
Public ReadOnly Property CellStyleScope As DataGridViewCellStyleScopes

Özellik Değeri

DataGridViewCellStyleScopes Değişen hücre stilinin hangi DataGridView varlığın sahibi olduğunu gösteren bir.

Örnekler

Aşağıdaki kod örneğinde bu üyenin kullanımı gösterilmektedir. Örnekte, bir olay işleyicisi olayın oluşumunu DataGridView.CellStyleContentChanged 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 DataGridView.CellStyleContentChanged emin olun.

private void DataGridView1_CellStyleContentChanged(Object sender, DataGridViewCellStyleContentChangedEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "CellStyle", e.CellStyle );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "CellStyleScope", e.CellStyleScope );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "CellStyleContentChanged Event" );
}
Private Sub DataGridView1_CellStyleContentChanged(sender as Object, e as DataGridViewCellStyleContentChangedEventArgs) _ 
     Handles DataGridView1.CellStyleContentChanged

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "CellStyle", e.CellStyle)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "CellStyleScope", e.CellStyleScope)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"CellStyleContentChanged Event")

End Sub

Açıklamalar

Hangi özelliğin CellStyleScope değiştirildiğini belirlemek için özelliğini DataGridViewCellStyle kullanın. CellStyle Güncelleştirilmiş değeri almak için özelliğini kullanın.

Şunlara uygulanır

Ayrıca bkz.