Binding.IsBinding 属性

获取指示绑定是否活动的值。

**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)

语法

声明
Public ReadOnly Property IsBinding As Boolean
用法
Dim instance As Binding
Dim value As Boolean

value = instance.IsBinding
public bool IsBinding { get; }
public:
property bool IsBinding {
    bool get ();
}
/** @property */
public boolean get_IsBinding ()
public function get IsBinding () : boolean

属性值

如果绑定处于活动状态,为 true;否则为 false

备注

如果绑定满足以下这些条件,则它处于活动状态:

示例

下面的代码示例输出窗体上的每个 BindingPropertyNameIsBinding 值。

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
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:
   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()
{
    for (int iCtr1 = 0; iCtr1 < this.get_Controls().get_Count(); iCtr1++) {
        Control c = this.get_Controls().get_Item(iCtr1);
        for (int iCtr2 = 0; iCtr2 < c.get_DataBindings().get_Count(); 
            iCtr2++) {
            Binding b = c.get_DataBindings().get_Item(iCtr2);
            Console.WriteLine(("\n" + c.ToString()));
            Console.WriteLine((b.get_PropertyName() + " IsBinding: " 
                + b.get_IsBinding()));
        }
    }
} //PrintBindingIsBinding
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);
      }
   }
}

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

.NET Compact Framework

受以下版本支持:2.0、1.0

请参见

参考

Binding 类
Binding 成员
System.Windows.Forms 命名空间