Formatting Bound Data

There is one more topic I thought I'd cover, because it's a really cool feature, but also because it comes in quite handy when dealing with some types of data. If you remember back in the code where you set up the DataBindings for each control (Listing 5.6), the Add method returns the Binding class instance that it just created in the DataBindings collection. Normally, you can ignore this as shown in Listing 5.6 and move on; however, it's sometimes useful to hold onto that return value and add event handlers to a pair of useful events. the Format and Parse events of the Binding class work together to transform a value in the database to and from a different display format. The Format event is fired when the state of the ...

Get Microsoft® Visual Basic® .NET 2003 Kick Start 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.