This documentation is archived and is not being maintained.

Binding.IsBinding Property

Gets a value indicating whether the binding is active.

[Visual Basic]
Public ReadOnly Property IsBinding As Boolean
[C#]
public bool IsBinding {get;}
[C++]
public: __property bool get_IsBinding();
[JScript]
public function get IsBinding() : Boolean;

Property Value

true, if the binding is active; otherwise, false.

Remarks

A binding is active when it meets these conditions: all its properties are set, the user did not call ResumeBinding or SuspendBinding on the BindingManagerBase that the Binding belongs to, and the control to which the Binding belongs has been created.

Example

The following example prints the PropertyName and IsBinding value for each Binding on a form.

[Visual Basic] 
Private Sub PrintBindingIsBinding
    Dim c As Control
    Dim b As Binding
    For Each c In Me.Controls
        For Each b in c.DataBindings
            Console.WriteLine (ControlChars.CrLf & c.ToString)
            Console.WriteLine (b.PropertyName & " IsBinding: " & _
                b.IsBinding)
        Next
    Next
End Sub

[C#] 
private void PrintBindingIsBinding()
{
   foreach(Control c in this.Controls)
   {
      foreach(Binding b in c.DataBindings)
      {
         Console.WriteLine("\n" + c.ToString());
         Console.WriteLine(b.PropertyName + " IsBinding: " 
             + b.IsBinding);
      }
   }
}


[C++] 
private:
   void PrintBindingIsBinding() {
      System::Collections::IEnumerator* myEnum = this->Controls->GetEnumerator();
      while (myEnum->MoveNext()) {
         Control* c = __try_cast<Control*>(myEnum->Current);
         System::Collections::IEnumerator* myEnum = c->DataBindings->GetEnumerator();
         while (myEnum->MoveNext()) {
            Binding* b = __try_cast<Binding*>(myEnum->Current);
            Console::WriteLine(S"\n {0}", c);
            Console::WriteLine(S"{0} IsBinding: {1}", b->PropertyName, __box(b->IsBinding));
         }
      }
   }


[JScript] 
private function PrintBindingIsBinding()
{
   for(var c : Control in this.Controls)
   {
      for(var b : Binding in c.DataBindings)
      {
         Console.WriteLine("\n" + c.ToString());
         Console.WriteLine(b.PropertyName + " IsBinding: " 
             + b.IsBinding);
      }
   }
}

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

Binding Class | Binding Members | System.Windows.Forms Namespace

Show: