# 【VB6】VB6类库项目中的Persistable

https://msdn.microsoft.com/en-us/library/aa268076(v=vs.60).aspx

# Visual Basic Reference

Visual Studio 6.0

# Persistable Property

Sets a value that determines if an object can save and restore data across instances. May only be set at design time.

Syntax

object.Persistable [= number]

The Persistable property syntax has these parts:

 Part Description object An object expression that evaluates to an object in the Applies To list. number An integer that specifies persistence behavior, as described in Settings.

Settings

The settings for number are:

 Constant Setting Description vbNotPersistable 0 (Default) The object can't be persisted. vbPersistable 1 The object can be persisted.

Remarks

The Persistable property is only available for classes that are public and creatable. When Persistable is set to vbPersistable, the following events are added to the class: InitPropertiesReadProperties, and WriteProperties. The PropertyChanged method is added to the class as well.