다음을 통해 공유


GridTableStylesCollection.CollectionChanged 이벤트

정의

컬렉션이 변경될 때 발생합니다.

public:
 event System::ComponentModel::CollectionChangeEventHandler ^ CollectionChanged;
public event System.ComponentModel.CollectionChangeEventHandler CollectionChanged;
member this.CollectionChanged : System.ComponentModel.CollectionChangeEventHandler 
Public Custom Event CollectionChanged As CollectionChangeEventHandler 

이벤트 유형

예제

다음 코드 예제에서는 이벤트에 대리자를 CollectionChangeEventHandler 추가합니다 CollectionChanged .

private:
   void AddHandler()
   {
      dataGrid1->TableStyles->CollectionChanged +=
         gcnew CollectionChangeEventHandler( this, &Form1::Collection_Changed );
   }

   void Collection_Changed( Object^ sender, CollectionChangeEventArgs^ e )
   {
      GridTableStylesCollection^ gts = (GridTableStylesCollection^)(sender);
      Console::WriteLine( gts->Count );
   }
private void AddHandler()
{
   dataGrid1.TableStyles.CollectionChanged += 
   new CollectionChangeEventHandler(Collection_Changed);
}

private void Collection_Changed
(object sender, CollectionChangeEventArgs e)
{
   GridTableStylesCollection gts = (GridTableStylesCollection)
   sender;
   Console.WriteLine(gts.Count);
}
Private Sub MyAddHandler()
    AddHandler dataGrid1.TableStyles.CollectionChanged, _
       AddressOf Collection_Changed
End Sub    
   
Private Sub Collection_Changed _
   (sender As Object, e As CollectionChangeEventArgs)
   
    Dim gts As GridTableStylesCollection = _
       CType(sender, GridTableStylesCollection)
    Console.WriteLine(gts.Count)
End Sub

설명

이벤트 처리에 대한 자세한 내용은 이벤트 처리 및 발생 을 참조하십시오.

적용 대상