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 6998877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:28:03+00:00 2026-05-27T20:28:03+00:00

I have a custom component with some published properties which have been used for

  • 0

I have a custom component with some published properties which have been used for a while in many projects. I want to make some particular changes to this component which requires removing these old properties and replacing them with new ones. Or otherwise, I’m not necessarily removing the properties, but let’s say I just simply change the name of a property from PropName to MyPropName instead. Well, the next time any project using that component is opened, it will not be able to find PropName.

Is there any way to automate conversion of this? Or is this something people will have to do manually? What would be the proper way to maintain component property values when the names of those properties are changed?

And I mean just in the DFM code, not necessarily inside the source code.

  • 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-27T20:28:04+00:00Added an answer on May 27, 2026 at 8:28 pm

    You can use the DefineProperties extension point to help migrate your .dfm files.

    type
      TMyComponent = class(...)
      private
        procedure ReadPropName(Reader: TReader);
      protected
        procedure DefineProperties(Filer: TFiler); override;
      published
        property MyPropName: string read ... write ...;
      end;
    
    procedure TMyComponent.DefineProperties(Filer: TFiler);
    begin
      inherited;
      Filer.DefineProperty('PropName', ReadPropName, nil, False);
    end;
    
    procedure TMyComponent.ReadPropName(Reader: TReader);
    begin
      MyPropName := Reader.ReadString;
    end;
    

    This will allow your new component to read in old .dfm files with the old property name. When the .dfm file is written again, the new property name will be used.

    Note that such a technique results in the component being able to read .dfm files containing either the old property name or the new property name so you can migrate in a gradual fashion if you wish. Once you have migrated all your .dfm files then it would be worth removing such code for the sake of tidiness.

    The Delphi documentation covers this subject area, albeit from a slightly different perspective, in the Storing and Loading Unpublished Properties section of the Component Writer’s Guide.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have a custom cursor while moused over the Google Maps component
I have implemented some component. I used jsp custom tags. But I've implemented 2
I have built a custom component using some containers and a TileList. Now when
I have written a new custom component derived from TLabel. The component adds some
I have a custom component which consists of 2 text view and 4 toggle
So I have a module in flex in which I add a custom component.
I have a component where i want to display a custom jtooltip. That is
I have a solution with many projects. One project contain few custom components. One
In my custom component I created some TAction-s as subcomponents. They're all published, but
I have a custom winforms control (inherits from Component) that has some strings displayed

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.