PropertyChanged Method

       

Notifies the container that a property’s value has been changed.

Syntax

object.PropertyChanged PropertyName

The PropertyChanged method syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
PropertyName A string expression that represents a name of the property that the control has changed the value of.

Remarks

By notifying the container that a property’s value has changed, the container can synchronize its Properties window with the new values of the object’s properties. Also, the container would not know if an instance of the object needed to be saved (through raising a WriteProperties event) unless the container was notified that a property’s value had changed.

This method needs to be called, for example, when a user changes a property value on a property page, or the object itself changes a property value. This method should also be called when a databound property is modified; otherwise the data source will not be updated.

Properties that are available only at run time do not need to call the PropertyChanged method, unless they can be data-bound.

As an example, the following code shows how the PropertyChanged method is used:

Public Property Let Address(ByVal cValue As String)
   m_Address = cValue
   PropertyChanged "Address"
End Property