event PropertyChange (Property as Property, Value as Variant)

Fired when the properties browser is about to change the property's value.

 TypeDescription 
   Property as Property A Property object that was changed using one of the control's editors, and it is about to change the property's value.  
   Value as Variant A Variant expression that specifies the newly value that will be passed to the property.  

The PropertyChange event notifies your application that user is about to change a property. If you are going to change the Value parameter during this event, make sure that your value is accepted by the property, else the control will popup an error message: "Invalid property value". To avoid showing error messages by the control when changing properties, set the InvalidValueMessage property to empty message.  The PropertyChange event is called, even if the user canceled the default implementation in ModalPropertyChange event. The control fires the EditChange event when user types characters in the property's text box control. The PropertyChanged event is fired after changing the value of the property. Use the Value property to retrieve the property's value. Use the Name property to retrieve the name of the property. Use the ID property to identify a property by its identifier.

The following sample prints the property's name and the property's newly value when user changes the property:

Private Sub PropertiesList1_PropertyChange(ByVal Property As EXPROPERTIESLISTLibCtl.IProperty, Value As Variant)
    Debug.Print "The """ & Property.Name & """'s value is changed. The newly value is " & Value
End Sub

Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.