共用方式為


BindingsCollection.Item[Int32] 屬性

定義

取得指定索引處的 Binding

public:
 property System::Windows::Forms::Binding ^ default[int] { System::Windows::Forms::Binding ^ get(int index); };
public System.Windows.Forms.Binding this[int index] { get; }
member this.Item(int) : System.Windows.Forms.Binding
Default Public ReadOnly Property Item(index As Integer) As Binding

參數

index
Int32

要尋找之 Binding 的索引。

屬性值

Binding

指定之索引處的 Binding

例外狀況

集合在指定索引處不包含項目。

範例

下列範例會 BindingMember 列印控制項 中 BindingsCollection 每個 Binding 的值。

void PrintBindingInfo()
{
   BindingsCollection^ bc = text1->DataBindings;
   for ( int i = 0; i < bc->Count; i++ )
      Console::WriteLine( bc[ i ]->BindingMemberInfo.BindingMember );
}
private void PrintBindingInfo()
{
   BindingsCollection bc = text1.DataBindings;
   for(int i = 0; i < bc.Count; i++)
      Console.WriteLine(bc[i].BindingMemberInfo.BindingMember);
}
Private Sub PrintBindingInfo()
   Dim bc As BindingsCollection = Text1.DataBindings
   Dim i As Integer 
   For i = 0 to bc.Count - 1
      Console.WriteLine(bc(i).BindingMemberInfo.BindingMember)
   Next i
End Sub

適用於

另請參閱