RAD Studio |  |

Updating the Property Page
See Also
Collapse All

Add code to the UpdatePropertyPage method to update the control on the property page when the properties of the ActiveX control change. You must add code to the UpdatePropertyPage method to update the property page with the current values of the ActiveX control's properties.

You can access the ActiveX control using the property page's OleObject property, which is an OleVariant that contains the ActiveX control's interface.

For example, the following code updates the property page's edit control (InputMask) with the current value of the ActiveX control's EditMask property:

Copy Code

    procedure TPropertyPage1.UpdatePropertyPage;
    begin
       { Update your controls from OleObject }
       InputMask.Text := OleObject.EditMask;
    end;

For example, the following code updates the property page&apos;s edit control (InputMask) with tthe current value of the ActiveX control&apos;s EditMask property:

Copy Code

    void __fastcall TPropertyPage1::UpdatePropertyPage(void)
    {
    InputMask->Text = OleObject.OlePropertyGet("EditMask");
    }

Note: It is also possible to write a property page that represents more than one ActiveX control. In this case, you don't use the OleObject property. Instead, you must iterate through a list of interfaces that is maintained by the OleObjects property.
See Also

Creating a Property Page for an ActiveX Control

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!