共用方式為


Binding.IsBinding 屬性

定義

取得值,指出繫結是否在作用中。

public:
 property bool IsBinding { bool get(); };
public bool IsBinding { get; }
member this.IsBinding : bool
Public ReadOnly Property IsBinding As Boolean

屬性值

Boolean

如果繫結處於作用中,則為 true,否則為 false

範例

下列程式碼範例會 PropertyName 列印表單上每個 Binding 的 和 IsBinding 值。

private:
   void PrintBindingIsBinding()
   {
      for each ( Control^ c in this->Controls )
      {
         for each ( Binding^ b in c->DataBindings )
         {
            Console::WriteLine( "\n {0}", c );
            Console::WriteLine( "{0} IsBinding: {1}",
               b->PropertyName, b->IsBinding );
         }
      }
   }
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);
      }
   }
}
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

備註

當系結符合下列條件時,系結會處於作用中狀態:

適用於