CurrencyManager object

What is the CurrencyManager object? I found many .NET samples with this object reference but when I can't declare an object of this type in VB.NET (and Visual Studio.NET IDE).

Many thanks

Cold

[197 byte] By [codefund.com] at [2007-12-16]
# 1
Binding is allowed on any IList. An IList is a list that allows certain operations, like adding an item, deleting an item, and getting the Nth item. What it doesn't have is knowledge of what item you're on (sometimes called Currency -- sorry, nothing to do with money). The form actually keeps track of what item you're on in each list using the BindingContext. If you have a TextBox with Text bound to your Customer's table's FirstName field, you could check _which_ FirstName you're looking at like this:
Console.WriteLine(BindingContext(customerTable).Position) 'if this prints 0, you're on the first
and you could change the current customer like this:
BindingContext(customerTable).Position = 5 'Move to the 6th customer (0-based)

BindingContext(customerTable) is a CurrencyManager.

You can also bind a property of a control to an object's property, like
TextBox2.DataBindings.Add("Text", Me, "Text")

BindingContext(Me) would keep track of the object you're bound to (in this case, it's just to see whether the property changes), and BindingContext(Me) would be a PropertyManager.

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 2
In addition to the other messages:

When you create a data source and use it on a form, the form (at load time) populates a collection of all those data sources. Each data source provides a single current row. For data sources, each data source is "wrapped up" by a CurrencyManager object, which inherits from the BindingManagerBase class. (There's also a PropertyManager class, which inherits from the same base class, which handles binding to properties).

Every form supplies a single BindingContext property by default, which returns a collection of the BindingManagerBase objects used on the form. In the 1.0 Framework documentation, you might try starting <a href="ms-help://MS.VSCC/MS.MSDNQTR.2003FEB.1033/vbcon/html/vboridatabindingwindowsforms.htm">here</a>.

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...