Updating the Property Page

From RAD Studio
Jump to: navigation, search

Go Up to Associating Property Page Controls with ActiveX Control Properties


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:

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

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

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 do not use the OleObject property. Instead, you must iterate through a list of interfaces that is maintained by the OleObjects property.

See Also