BindingManagerBase.Bindings Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Extrait la collection des liaisons managées.
public:
property System::Windows::Forms::BindingsCollection ^ Bindings { System::Windows::Forms::BindingsCollection ^ get(); };
public System.Windows.Forms.BindingsCollection Bindings { get; }
member this.Bindings : System.Windows.Forms.BindingsCollection
Public ReadOnly Property Bindings As BindingsCollection
Valeur de propriété
BindingsCollection contenant les objets Binding managés par le BindingManagerBase.
Exemples
L’exemple de code suivant obtient le BindingManagerBase pour une source de données spécifique. L’exemple utilise ensuite la Bindings propriété pour imprimer des informations sur chaque contrôle lié à la même source de données.
void PrintBoundControls()
{
BindingManagerBase^ myBindingBase = this->BindingContext[ ds,"customers" ];
System::Collections::IEnumerator^ myEnum = myBindingBase->Bindings->GetEnumerator();
while ( myEnum->MoveNext() )
{
Binding^ b = safe_cast<Binding^>(myEnum->Current);
Console::WriteLine( b->Control );
}
}
private void PrintBoundControls()
{
BindingManagerBase myBindingBase = this.BindingContext[ds, "customers"];
foreach(Binding b in myBindingBase.Bindings)
{
Console.WriteLine(b.Control.ToString());
}
}
Private Sub PrintBoundControls()
Dim myBindingBase As BindingManagerBase = Me.BindingContext(ds, "customers")
Dim b As Binding
For Each b In myBindingBase.Bindings
Console.WriteLine(b.Control.ToString())
Next b
End Sub
S’applique à
Voir aussi
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de l’année 2024, nous abandonnerons progressivement le mécanisme de retour d’information GitHub Issues pour le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultez :Soumettre et afficher des commentaires pour