How to change the default value for the Margins property?

Viewed 2686

Using the Delphi XE2 wizard to create a component, I have choose the TPanel to inherit from, and change defaults of some properties to fit my application.

My problem is to change the default of Margins:

  TControl = class(TComponent)
    ...
    property Margins: TMargins read FMargins write SetMargins;

Margins is a TMargin class declared with 4 properties that I need to redefine the defaults:

  TMargins = class(TPersistent)
  published
    property Left: TMarginSize index 0 read FLeft write SetMargin default 3;
    property Top: TMarginSize index 1 read FTop write SetMargin default 3;
    property Right: TMarginSize index 2 read FRight write SetMargin default 3;
    property Bottom: TMarginSize index 3 read FBottom write SetMargin default 3;

I can/will be setting on code the margins when the constructor of the component is called, however I have no idea how to redefine these defaults above in order to show up on the property editor.

1 Answers
Related