Control.BindingContextChanged Control.BindingContextChanged Control.BindingContextChanged Control.BindingContextChanged Event

定义

BindingContext 属性的值更改时发生。Occurs when the value of the BindingContext property changes.

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

示例

下面的代码示例将一个EventHandler委托添加BindingContextChangedTextBox控件的事件。The following code example adds an EventHandler delegate to the BindingContextChanged event of a TextBox control.

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

注解

若要通过BindingContext BindingContext Control 属性向添加新的,请BindingContext参见构造函数。To add a new BindingContext to the Control through the BindingContext property, see the BindingContext constructor.

如果更改了BindingContext属性,则会引发此事件,方法是编程修改或用户交互。This event is raised if the BindingContext property is changed is changed by either a programmatic modification or user interaction.

有关处理事件的详细信息, 请参阅处理和引发事件For more information about handling events, see Handling and Raising Events.

适用于

另请参阅