Property Procedures

Property procedures are procedures which can return and assign values, and set references to Objects. You can use Property procedures to create and manipulate custom properties. Property procedures can be used to create read-only properties for Forms, Standard modules and Class modules. Property procedures should be used instead of public variables whenever you have code that must be executed when the property value is set. Unlike public variables, property procedures can have help strings assigned to them in the Object Browser. When you create a Property procedure, the new property is a property of the module containing the procedure. Visual Basic provides three kinds of Property procedures, as described in the following table.

Property procedure

Description

Property Let

A procedure that sets the value of a property.

Property Get

A procedure that returns the value of a property.

Property Set

A procedure that sets a reference to an object.

No comments:

Post a Comment