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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:18:01+00:00 2026-06-18T06:18:01+00:00

It is quite simple to enumerate Form components for (int i=0;i<ComponentCount;i++) { ShowMessage(Components[i]->Name); //…..

  • 0

It is quite simple to enumerate Form components

         for (int i=0;i<ComponentCount;i++)
         {
            ShowMessage(Components[i]->Name);
            //.....
         }

but the same thing does not work if I want to enumerate only the components which are located on Panel.

         for (int i=0;i<Panel1->ComponentCount;i++)
         {
            ShowMessage(Panel1->Components[i]->Name);
            //.....
         }

because

            Panel1->ComponentCount;

is just zero while having several components on Panel. So, how can I enumerate the child components of Panel?

  • 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-18T06:18:02+00:00Added an answer on June 18, 2026 at 6:18 am

    The ComponentCount and Components[] properties access a component’s list of owned components – components that have the component set as their Owner by having that component passed to their constructor. All components created at design-time have the parent TForm (or TFrame or TDataModule) set as their Owner. Your first loop is iterating through the TForm’s owned components, that is why it works. Your TPanel does not own any components, that is why the second loop fails.

    What you are looking for is the ControlCount and Controls[] properties instead. They access a visual control’s list of child controls instead – controls that have the parent control set as their Parent for purposes of visual representation. Only TWinControl-derived controls (like TPanel) can have child controls:

    for (int i = 0; i < Panel1->ControlCount; ++i)
    {
        ShowMessage(Panel1->Controls[i]->Name);
        //.....
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is quite simple but I being not very efficient with jQuery finding it
Its quite simple thing which i am doing, i have done it before but
Things looked quite simple first but in the end the result is not good.
This should be quite simple, but I can't work out the syntax. I have
The problem is probably quite simple. $q = SELECT id FROM users WHERE name
It's quite simple, I don't understand why the following does match: preg_match('/\<td valign=top class=bericht\>(.*\s)*<\/td>/',$html,$matches3);
My schema is quite simple- Each user has an id and name. There are
This is probably quite simple, but I just don't know how to do this...
The question is quite simple, the answer may not be. Basically, in my application
I'm using the extension menthod Reverse(), but it does not seem to be doing

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.