D.7. New Object Models

Visual Basic is becoming a more object-oriented language, and much of the new functionality available to VB6 programmers comes in the form of object models that can be referenced and used within VB.

Data binding and formatting

One of the most important additions to VB6 is the data binding functionality provided by the BindingCollection and Binding objects. The data bindings object model allows you to bind a field of a data source to any property of any form control. It's more powerful and affords the developer more control than the previous data controls in Visual Basic.

The new data binding object model includes the Data Format object, which allows you to seamlessly format data from the data source before displaying it in the control, and then unformat the data before it's written to the data source.

For information, see Reference entry "Data Binding Objects (VB6)" and Reference entry "Data Format Objects (VB6)" in Chapter 7.

Dictionary object

A member of the Scripting Runtime Library, the Dictionary object is a much-enhanced version of the Collection object. It's faster in execution and easier to use.

For details, see Reference entry "Dictionary Object (VB6)" in Chapter 7.

File System objects

Another member of the Scripting Runtime Library, the File System objects provide a powerful new model representing all connected drives and the folders and files in them. The model is well-designed and is therefore straightforward and intuitive to use. Any drive ...

Get VB & VBA in a Nutshell: The Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.