Data Format Objects VB Library to Reference

Microsoft Data Formatting Object Library (../SYSTEM32/MSSTDFMT.DLL) Description

The Data Format objects can be used only in conjunction with the Data Binding objects, although their use isn't mandatory. They allow you to perform complex formatting operations with a minimum of code. For example, formatting null data or mapping a data field to a checkbox are common operations you had to code manually in almost all database applications. Now these operations can be handled with just a few lines of code.

The object model, which is shown in Figure 7-3, consists of a collection object, a format object, and a value object. For most applications, you want to create a formats collection object to hold the various format objects you use in the application, but you can also simply create a format object without using the collection. The value object isn't createable and is available only when it's passed to the format object's Format or Unformat events.

192 Chapter 7- The Language Reference stdDataFormatsI

stdDataFormat stdDataValue

Figure 7-3: The Data Format object model

When you bind a data source to a control using the bindings collection, you can specify a Format object to bind with them. As data is read from the source, it's formatted and displayed automatically. When data is read from the control and written back to the data source, it's unformatted automatically. For complex formatting operations, you can use the Format and Unformat events to code the formatting and unformatting of data.

See Also stdDataFormat Object, stdDataFormats Object

Was this article helpful?

0 0

Post a comment