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 of any type that is connected to a system, including networked and CD-ROM drives, is included in the Drives collection.

The File System Folders collection and Folder objects give you complete control when moving, adding, and deleting folders and their contents, unlike the built-in VB functions that require you to empty folders prior to deletion. You can also determine and return special Windows folders such as System32.

The Files collection and File objects again allow you to move, copy, and delete files, and provide useful properties to both set and return a file's attributes.

For full details, see Reference entry "File System Object Model (VB6)" in Chapter 7.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.196.234