EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

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 BindingMemberInfo BindingMemberInfo { get; }
/** @property */
public BindingMemberInfo get_BindingMemberInfo ()

public function get BindingMemberInfo () : BindingMemberInfo

Not applicable.

Property Value

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 void PrintBindingMemberInfo()
{
   foreach(Control thisControl in this.Controls)
   {
      foreach(Binding thisBinding in thisControl.DataBindings)
      {
         // Print the control's name and Binding information.
         Console.WriteLine("\n" + thisControl.ToString());
         BindingMemberInfo bInfo = thisBinding.BindingMemberInfo;
         Console.WriteLine("Binding Path \t" + bInfo.BindingPath);
         Console.WriteLine("Binding Field \t" + bInfo.BindingField);
         Console.WriteLine("Binding Member \t" + bInfo.BindingMember);
      }
   }
}

private void PrintBindingMemberInfo()
{
    for (int iCtr1 = 0; iCtr1 < this.get_Controls().get_Count(); iCtr1++) {
        Control thisControl = this.get_Controls().get_Item(iCtr1);
        for (int iCtr2 = 0; 
            iCtr2 < thisControl.get_DataBindings().get_Count(); iCtr2++) {
            Binding thisBinding = 
                thisControl.get_DataBindings().get_Item(iCtr2);

            // Print the control's name and Binding information.
            Console.WriteLine(("\n" + thisControl.ToString()));
            BindingMemberInfo bInfo = thisBinding.get_BindingMemberInfo();
            Console.WriteLine("Binding Path \t" + 
                bInfo.get_BindingPath());
            Console.WriteLine("Binding Field \t" + bInfo.get_BindingField());
            Console.WriteLine("Binding Member \t" + 
                bInfo.get_BindingMember());
        }
    }
} //PrintBindingMemberInfo

private function PrintBindingMemberInfo()
{
   for(var i : int = 0; i < this.Controls.Count; i ++)
   {
      for(var j : int = 0; j < this.Controls[i].DataBindings.Count; j++)
      {
         // Print the control's name and Binding information.
         Console.WriteLine("\n" + this.Controls[i].ToString());
         var bInfo : BindingMemberInfo  = this.Controls[i].DataBindings[j].BindingMemberInfo;
         Console.WriteLine("Binding Path \t" + bInfo.BindingPath);
         Console.WriteLine("Binding Field \t" + bInfo.BindingField);
         Console.WriteLine("Binding Member \t" + bInfo.BindingMember);
      }
   }
}

Windows 98, Windows Server 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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Ajouts de la communauté

AJOUTER
Afficher: