Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1072891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:55:16+00:00 2026-05-16T20:55:16+00:00

For instance, like Font. Can anyone give a very simple example? Maybe just a

  • 0

For instance, like Font. Can anyone give a very simple example? Maybe just a property with two sub-properties


Edit: I mean that when I look at Font in the object inspector it has a little plus sign which I can click to set font name “times new roman”, font size “10”, etc. Sorrry if I use the wrong terms, that is what I menat by “sub-properties”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:55:16+00:00Added an answer on May 16, 2026 at 8:55 pm

    All you have to do is create a new published property that points to an type that has published properties.

    check this code

      type
        TCustomType = class(TPersistent) //this type has 3 published properties
        private
          FColor : TColor;
          FHeight: Integer;
          FWidth : Integer;
        public
          procedure Assign(Source: TPersistent); override;
        published
          property Color: TColor read FColor write FColor;
          property Height: Integer read FHeight write FHeight;
          property Width : Integer read FWidth write FWidth;
        end;
    
        TMyControl = class(TWinControl) 
        private
          FMyProp : TCustomType;
          FColor1 : TColor;
          FColor2 : TColor;
          procedure SetMyProp(AValue: TCustomType);
        public
          constructor Create(AOwner: TComponent); override;
          destructor Destroy; override;
        published
          property MyProp : TCustomType read FMyProp write SetMyProp; //now this property has 3 "sub-properties" (this term does not exist in delphi)
          property Color1 : TColor read FColor1 write FColor1;
          property Color2 : TColor read FColor2 write FColor2;
        end;
    
      procedure TCustomType.Assign(Source: TPersistent);
      var
        Src: TCustomType;
      begin
        if Source is TCustomType then
        begin
          Src := TCustomType(Source);
          FColor := Src.Color;
          Height := Src.Height;
          FWidth := Src.Width;
        end else
          inherited;
      end;
    
      constructor TMyControl.Create(AOwner: TComponent);
      begin
        inherited;
        FMyProp := TCustomType.Create;
      end;
    
      destructor TMyControl.Destroy;
      begin
        FMyProp.Free;
        inherited;
      end;
    
      procedure TMyControl.SetMyProp(AValue: TCustomType);
      begin
        FMyProp.Assign(AValue);
      end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to give my HtmlHelper textbox an id ? For instance like
If I create a SslStream instance like this: secureStream = new SslStream(stream, true, tlsRemoteCallback,
For the option to launch a new EC2 instance like this one, how similar
In python, it is illegal to create new attribute for an object instance like
I'd like an instance variable object to adopt a protocol. @interface GameScene : Scene
I wrote something like this: instance Functor (Either e) where fmap _ (Left a)
I'm enumerating all databases of an SQL Server 2005 instance using SMO like as
I like to create an instance of a custom class by passing it a
I would like to get View instance that is used to display specific Preference
I'd like to setup one instance of MySQL to flat-out reject certain types of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.