Binding.BindingMemberInfo Property


Gets an object that contains information about this binding based on the dataMember parameter in the Binding constructor.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

Public ReadOnly Property BindingMemberInfo As BindingMemberInfo

Property Value

Type: System.Windows.Forms.BindingMemberInfo

A BindingMemberInfo that contains information about this Binding.

The BindingMemberInfo is created from the dataMember string passed to the Binding constructor.

The following code example gets the BindingMemberInfo of each Binding on a form, and prints the BindingPath, BindingField, and BindingMember property values for that Binding.

Private Sub PrintBindingMemberInfo()
    Dim thisControl As Control
    For Each thisControl In  Me.Controls
        Dim thisBinding As Binding
        For Each thisBinding In  thisControl.DataBindings
            ' Print the control's name and Binding information.
            Console.WriteLine(ControlChars.Cr + thisControl.ToString())
            Dim bInfo As BindingMemberInfo = thisBinding.BindingMemberInfo
            Console.WriteLine("Binding Path " + ControlChars.Tab _
                             + bInfo.BindingPath)
            Console.WriteLine("Binding Field " + ControlChars.Tab _
                             + bInfo.BindingField)
            Console.WriteLine("Binding Member " + ControlChars.Tab _
                             + bInfo.BindingMember)
        Next thisBinding
    Next thisControl
End Sub

.NET Framework
Available since 1.1
Return to top