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

The Archive Base Latest Questions

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

I has a piece of code where I override TStringGrid’s inplace editor and the

  • 0

I has a piece of code where I override TStringGrid’s inplace editor and the hint window. For this, I created my own string grid based on TStringGrid and use a TEdit for inplace editor and a TPanel for tool tips. In TMyStringGrid.Create constructor I initialize them like this:

Constructor TMyStringGrid.Create();
Begin
  inherited Create(AOwner);
  MyEditor:= TEdit.Create(Self);  
  MyEditor.Parent  := Self;
End;

In this case the owner (the main form) is freeing the controls. I used this for years and it worked.
The thing is that other people argue that the programmer should use NIL instead the Self when instantiation the child controls and later to manually free them in the Destroy destructor. It seems that the second alternative has gigantic advantage over the first one, especially when you dynamically create lots of child controls (not my case). Other problem with my code, they say, is that the child controls may be freed after an Application.ProcessMessages call while the application may still want to use them.

So, I should let my code unchanged or should I manually create and free the child controls?
There is a any Borland example of compound controls?


Delphi 7, Win XP
Reference: http://delphi.about.com/od/kbcurt/ss/dynamiccreateno.htm

  • 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:00:32+00:00Added an answer on May 16, 2026 at 8:00 pm

    Yes you can use your code without changing it.

    There is a any Borland example of compound controls?
    

    Best example is to check the implementation of TLabeledEdit.

    It was creating the label in constructor

      if Assigned(FEditLabel) then exit;
      FEditLabel := TBoundLabel.Create(Self);
      FEditLabel.FreeNotification(Self);
      FEditLabel.FocusControl := Self;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The View Programming Guide for iOS on pg. 57 has this piece of code:
This piece of code has been taken from a game built with XNA framework.
i was following an ACL tut. which has used this piece of code. class
I have this piece of code that has a problem. so can you help
I'm writing a piece of code with linq which has to hash a string
Ok, someone has just shown me a piece of PHP code and at the
This piece of valid json (it has been generated using php's json_encode): {html:form is
I have this piece of code from GWT in Action: public void processOperator(final AbstractOperator
If anyone familiar with Rebecca Wirfs-Brock, she has a piece of Java code found
I have inherited a piece of code which has a series of functions like

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.