Properties

Properties are the public way that callers have to access data stored within fields. With properties you decide what kind of permissions users can have to read and write the actual information. Properties are typically used as fields but they act as methods. In Visual Basic 2010, properties have been completely revisited; in fact, until Visual Basic 2008, a typical property was implemented as follows:

image

You had a private field in which you stored an incoming value and whose value you returned to the callers. Now in Visual Basic 2010, the same property can be defined as follows:

Public Property FirstName As String

This feature is known ...

Get Visual Basic® 2010 Unleashed 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.