ListChangedEventArgs.ListChangedType Özellik
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Değişiklik türünü alır.
public:
property System::ComponentModel::ListChangedType ListChangedType { System::ComponentModel::ListChangedType get(); };
public System.ComponentModel.ListChangedType ListChangedType { get; }
member this.ListChangedType : System.ComponentModel.ListChangedType
Public ReadOnly Property ListChangedType As ListChangedType
Özellik Değeri
ListChangedType Değişiklik türünü gösteren değer.
Örnekler
Aşağıdaki kod örneğinde bu üyenin kullanımı gösterilmektedir. Örnekte, bir olay işleyicisi olayın oluşumunu BindingSource.ListChanged 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ı BindingSource1
bir tür BindingSource örneği içeren bir projeye yapıştırın. Ardından olay işleyicisinin olayla ilişkilendirildiğinden BindingSource.ListChanged emin olun.
private void BindingSource1_ListChanged(Object sender, ListChangedEventArgs e) {
System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "ListChangedType", e.ListChangedType );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "NewIndex", e.NewIndex );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "OldIndex", e.OldIndex );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "PropertyDescriptor", e.PropertyDescriptor );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "ListChanged Event" );
}
Private Sub BindingSource1_ListChanged(sender as Object, e as ListChangedEventArgs) _
Handles BindingSource1.ListChanged
Dim messageBoxVB as New System.Text.StringBuilder()
messageBoxVB.AppendFormat("{0} = {1}", "ListChangedType", e.ListChangedType)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "NewIndex", e.NewIndex)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "OldIndex", e.OldIndex)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "PropertyDescriptor", e.PropertyDescriptor)
messageBoxVB.AppendLine()
MessageBox.Show(messageBoxVB.ToString(),"ListChanged Event")
End Sub
Şunlara uygulanır
Ayrıca bkz.
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin