BindingManagerBase.ResumeBinding 方法

定义

当在派生类中被重写时,恢复数据绑定。

public:
 abstract void ResumeBinding();
public abstract void ResumeBinding ();
abstract member ResumeBinding : unit -> unit
Public MustOverride Sub ResumeBinding ()

示例

void button4_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
{
   try
   {
      BindingManagerBase^ myBindingManager2 = BindingContext[ myDataSet, "Customers" ];
      myBindingManager2->ResumeBinding();
   }
   catch ( Exception^ ex ) 
   {
      MessageBox::Show( ex->Source );
      MessageBox::Show( ex->Message );
   }
}
private void button4_Click(object sender, EventArgs e)
{
   try
   {
      BindingManagerBase myBindingManager2=BindingContext [myDataSet, "Customers"];
      myBindingManager2.ResumeBinding();
   }
   catch(Exception ex)
   {
      MessageBox.Show(ex.Source);
      MessageBox.Show(ex.Message);
   }
}
Private Sub button4_Click(sender As Object, e As EventArgs)
   Try
      Dim myBindingManager2 As BindingManagerBase = BindingContext(myDataSet, "Customers")
      myBindingManager2.ResumeBinding()
   Catch ex As Exception
      MessageBox.Show(ex.Source.ToString())
      MessageBox.Show(ex.Message.ToString())
   End Try
End Sub

注解

SuspendBindingResumeBinding 是允许临时挂起和恢复数据绑定的两种方法。 如果必须允许用户在验证之前编辑数据字段,通常会暂停数据绑定。 例如,用户可能需要根据第二个字段更改字段;否则,验证第一个字段将导致第二个字段出错。

适用于

另请参阅