Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can you bind a winform control to a property or variable
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00661277
Message ID:
00662053
Vues:
30
Mike,

Yes, you can bind a Win control to an object's property as long as the data types are compatable. Here is an example:

Public Sub UpdateBindings()

'create the customer object...
Dim customer As New Customer()
customer.Id = 27
customer.FirstName = "John"
customer.LastName = "Doe"

'bind it...
mybutton.DataBindings.Add("Text",customer,"FirstName")


>All I can seem to find is a way to bind them to datasets. Even the few examples I've found in C# books show code catching events and manually changing the value to simulate binding. Is that the best way?
>
>Thanks,
>Mike
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform