event ModalPropertyChange (Property as Property, Value as Variant, Cancel as Boolean)

Fired when the properties browser is about to change a property's value using a modal dialog.

TypeDescription
Property as Property A Property object being changed using a modal dialog.
Value as Variant A Variant expression that indicates the newly property's value.
Cancel as Boolean A boolean expression that indicates whether the control disables or enables the default implementation.

Use the ModalPropertyChange event to replace the default implementation of modal type editors ( IFontDisp (font) properties, IPictureDisp (picture) properties, object properties pages, EditPage, EditColorPage, EditButton types ). The "Invalid property value" message is displayed if the Property does not accept the Value. To avoid showing error messages set the InvalidValueMessage property to an empty string. 

Syntax for ModalPropertyChange event, /NET version, on:

private void ModalPropertyChange(object sender,exontrol.EXPROPERTIESLISTLib.Property Property,ref object Value,ref bool Cancel)
{
}

Private Sub ModalPropertyChange(ByVal sender As System.Object,ByVal Property As exontrol.EXPROPERTIESLISTLib.Property,ByRef Value As Object,ByRef Cancel As Boolean) Handles ModalPropertyChange
End Sub

Syntax for ModalPropertyChange event, /COM version, on:

private void ModalPropertyChange(object sender, AxEXPROPERTIESLISTLib._IPropertiesListEvents_ModalPropertyChangeEvent e)
{
}

void OnModalPropertyChange(LPDISPATCH Property,VARIANT FAR* Value,BOOL FAR* Cancel)
{
}

void __fastcall ModalPropertyChange(TObject *Sender,Expropertieslistlib_tlb::IProperty *Property,Variant * Value,VARIANT_BOOL * Cancel)
{
}

procedure ModalPropertyChange(ASender: TObject; Property : IProperty;var Value : OleVariant;var Cancel : WordBool);
begin
end;

procedure ModalPropertyChange(sender: System.Object; e: AxEXPROPERTIESLISTLib._IPropertiesListEvents_ModalPropertyChangeEvent);
begin
end;

begin event ModalPropertyChange(oleobject Property,any Value,boolean Cancel)
end event ModalPropertyChange

Private Sub ModalPropertyChange(ByVal sender As System.Object, ByVal e As AxEXPROPERTIESLISTLib._IPropertiesListEvents_ModalPropertyChangeEvent) Handles ModalPropertyChange
End Sub

Private Sub ModalPropertyChange(ByVal Property As EXPROPERTIESLISTLibCtl.IProperty,Value As Variant,Cancel As Boolean)
End Sub

Private Sub ModalPropertyChange(ByVal Property As Object,Value As Variant,Cancel As Boolean)
End Sub

LPARAMETERS Property,Value,Cancel

PROCEDURE OnModalPropertyChange(oPropertiesList,Property,Value,Cancel)
RETURN

Syntax for ModalPropertyChange event, /COM version (others), on:

<SCRIPT EVENT="ModalPropertyChange(Property,Value,Cancel)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function ModalPropertyChange(Property,Value,Cancel)
End Function
</SCRIPT>

Procedure OnComModalPropertyChange Variant llProperty Variant llValue Boolean llCancel
	Forward Send OnComModalPropertyChange llProperty llValue llCancel
End_Procedure

METHOD OCX_ModalPropertyChange(Property,Value,Cancel) CLASS MainDialog
RETURN NIL

void onEvent_ModalPropertyChange(COM _Property,COMVariant /*variant*/ _Value,COMVariant /*bool*/ _Cancel)
{
}

function ModalPropertyChange as v (Property as OLE::Exontrol.PropertiesList.1::IProperty,Value as A,Cancel as L)
end function

function nativeObject_ModalPropertyChange(Property,Value,Cancel)
return

The following sample replaces the editor for properties of IPictureDisp (picture) type ( the sample uses Type property of the Property to check the property's type. The sample doesn't use the statement typeof Property.Object is IPictureDisp because the Object property might be set to nothing, and so the operator typeof will be unable to determine the type of the object ):

Private Sub PropertiesList1_ModalPropertyChange(ByVal Property As EXPROPERTIESLISTLibCtl.IProperty, Value As Variant, Cancel As Boolean)
    If Property.Type = "Picture*" Then
        MsgBox "Invoke your dialog here, and change the Value parameter, when your dialog is closed."
        Value = StdFunctions.LoadPicture("c:\winnt\system32\setup.bmp")
        Cancel = True
    End If
End Sub

The following sample shows how to change the default font editor:

Private Sub PropertiesList1_ModalPropertyChange(ByVal Property As EXPROPERTIESLISTLibCtl.IProperty, Value As Variant, Cancel As Boolean)
    If (Property.Type = "Font*") Then
        MsgBox "Use your implementation here"
        Set Value = Me.Font
        Cancel = True
    End If
End Sub