Updating the Object

From RAD Studio
Jump to: navigation, search

Go Up to Associating Property Page Controls with ActiveX Control Properties

Add code to the UpdateObject method to update the property when the user changes the controls on the property page. You must add code to the UpdateObject method in order to set the properties of the ActiveX control to their new values.

You use the OleObject property to access the ActiveX control.

For example, the following code sets the EditMask property of the ActiveX control using the value in the property page's edit box control (InputMask):

procedure TPropertyPage1.UpdateObject;
   {Update OleObject from your control }
   OleObject.EditMask := InputMask.Text;
void __fastcall TPropertyPage1::UpdateObject(void)
  // Update OleObject from your control
  OleObject.OlePropertySet<WideString>("EditMask", WideString(InputMast->Text).Copy());

See Also