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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:17:47+00:00 2026-06-09T21:17:47+00:00

I want to create a custom TPanel that has a TImage32 in it. The

  • 0

I want to create a custom TPanel that has a TImage32 in it.
The image won’t align to the parent until I manually resize the parent control. After that it will stay nicely aligned.
Why?

TYPE
  TDisplay1= class(TPanel)
   private
    Ready: Boolean;
    RightPnl       : TPanel;
    ShowA          : TSpeedButton;
    Display        : TImage32;
   protected
    procedure Resize; override;
   public
    constructor Create(AOwner: TComponent); override;
    destructor  Destroy; override;
  end;

IMPLEMENTATION



procedure TDisplay1.Resize;    <-------- the culprit was here as suggested by Vahid
begin
 inherited;
 if Ready
 then Display.SetupBitmap(TRUE, clYellow32);
end;

Update:
I am working o a solution with an alternative way to load the control. I will let you know if I succeed.

Update2:
Vahid answer’s was better. Thanks Vahid.

  • 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-06-09T21:17:48+00:00Added an answer on June 9, 2026 at 9:17 pm

    Add this code to your panel:

    ...
    protected
       procedure Paint; override;
    ...
    procedure TDisplay1.Paint;
    begin
     inherited;
     if Ready then Display.SetupBitmap(TRUE, clYellow32);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a custom control derived from TPanel that contains an image
I want to create custom WPF control that has a single child control inside.
I want to create a custom control that extends a built-in control and then
I want to create custom control (let's name it DesignPanel ) that will allow
i want create a custom json data from the mssql 2008 results so that
I want to create a custom set that will automatically convert objects into a
I want to create a custom style for an activity that will look like
i want to create the custom menu control in UIWebView, by using - (void)
I want to create custom templated control which controls inside of template coluld be
I want to create simple custom control (derived from control and with look defined

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.