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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:05:31+00:00 2026-06-13T13:05:31+00:00

I had a PANEL on the form. Then dynamically I create many more panels

  • 0

I had a PANEL on the form. Then dynamically I create many more panels and place them on the form to look like a menu.

By mistake I deleted the main PANEL. then put it back as a new control.

Now the dynamic buttons don’t show. But there’s no error. So I’m guessing that the dynamic components are there but invisible (behind the main PANEL).

Is there a way to fix this? I can’t seem to find a z-order property for the components.

Please help.

Here’s the code segment:

  For MenuItemCount:= 1 to MenuItemLimit Do
      Begin
      MenuButtons[MenuItemCount] := TPanel.Create(Self);
      With MenuButtons[MenuItemCount] do
          begin

            Width:=180 - (10*MenuItem[MenuItemCount].Level);
            Left:=4+10*MenuItem[MenuItemCount].Level;

            Height:=25;
            Top:= 5 + Height * (MenuItemCount-1);
            Color:= clMenu;
            Cursor:=crHandPoint;

            Parent := MenuGroup; //Parent container for the items.

            Caption := MenuItem[MenuItemCount].Title;

      end;//End for

MenuGroup is the parent panel that is placed at design-time.

  • 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-13T13:05:32+00:00Added an answer on June 13, 2026 at 1:05 pm

    There is the method SendToBack, which lets you send a control to the back (and its BringToFront counterpart).

    But I think it won’t solve your problem. The ‘Z-order’ of components by default is the order in which they are created. The design time panel is created before the dynamic panels, even once you have removed it and put a new one on the form.

    What I think happened (though it’s a hard guess without seeing your code), is that you tried to find the panel by name, like this:

    var
      ParentPanel: TPanel;
      DynamicPanel: TPanel;
    begin
      ParentPanel := FindComponent('PanelX') as TPanel;
    
      DynamicPanel := TPanel.Create(Self);
      DynamicPanel.Parent := ParentPanel;
    

    This would work, but if you remove PanelX, and put in a new panel with a slightly different name, FindComponent won’t find the panel and return nil. The DynamicPanels will have nil as a parent, causing them not to show up.

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

Sidebar

Related Questions

hello In my Form I had used multiple container such as panel,group box.and as
i originally had a main form with 2 panels, one had a graph in
When I still had VS2005 there were a Memory and a Register panel available
I am coding a form generator. So far, so good, then I decided to
Guys, I have a windows form with a panel control and inside the panel
I am working on a wizard form framework that will allow me easily create
I have a simple form with one text box and a panel with three
I have a form that has an array of dynamically created labels of varying
Im working on a program which moves a panel within a form. I use
I've had a look through several posts here and on forums - however I

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.