Control.BindingContextChanged Evento

Definição

Ocorre quando o valor da BindingContext propriedade muda.

public:
 event EventHandler ^ BindingContextChanged;
public event EventHandler BindingContextChanged;
member this.BindingContextChanged : EventHandler 
Public Custom Event BindingContextChanged As EventHandler 

Tipo de Evento

Exemplos

O seguinte exemplo de código adiciona um EventHandler delegado ao BindingContextChanged evento de um TextBox controlo.

private:
   void AddEventHandler()
   {
      textBox1->BindingContextChanged += gcnew EventHandler(
         this, &Form1::BindingContext_Changed );
   }

   void BindingContext_Changed( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      Console::WriteLine( "BindingContext changed" );
   }
private void AddEventHandler()
{
   textBox1.BindingContextChanged += new EventHandler(BindingContext_Changed);
}

private void BindingContext_Changed(object sender, EventArgs e)
{
   Console.WriteLine("BindingContext changed");
}
Private Sub AddEventHandler()
    AddHandler textBox1.BindingContextChanged, _
       AddressOf BindingContext_Changed
End Sub    
   
Private Sub BindingContext_Changed(sender As Object, e As EventArgs)
    Console.WriteLine("BindingContext changed")
End Sub

Observações

Para adicionar um novo BindingContext ao Control atravessar a BindingContext propriedade, consulte o BindingContext construtor.

Este evento é ativado se a BindingContext propriedade alterada for alterada por uma modificação programática ou por interação do utilizador.

Para obter mais informações sobre como manipular eventos, consulte Manipulando e gerando eventos.

Aplica-se a

Ver também