Visual Basic Reference

ReadProperty Method

See Also    Example    Applies To

Returns a saved value from a PropertyBag class object.

Syntax

object**.ReadProperty(DataName[, DefaultValue])**

The ReadProperty method syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
DataName A string expression that represents a data value in the property bag.
DefaultValue The value to be returned if no value is present in the property bag.

Remarks

The ReadProperty method will return the value of the saved data that is represented by the string expression DataName, or DefaultValue if there is no saved value. DataName should match the string expression that was used to store the saved data value in the property bag.

Note   Specifying a default value reduces the size of the file belonging to the container of the control. A line for the property is written to the file only if the value to be written is different**from the default. Wherever possible, you should specify default values for the properties of the control when initializing, saving, and retrieving property values.