BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Panel1->ComponentCount returned 0 Why ?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Sam
Guest





PostPosted: Thu Jun 24, 2004 11:52 am    Post subject: Panel1->ComponentCount returned 0 Why ? Reply with quote



I a panel and droped on some buttons and checkBox.
I need to make a special process for all components that are owned by the
panel.
the propertie Panel1->ComponentCount contains always 0, why ?

TComponent *Temp;

for (I = Panel1->ComponentCount - 1; I >= 0; I--)

{
Temp = Panel1->Components[I];
ShowMessage(Temp->Name);
}


Back to top
Eelke Klein
Guest





PostPosted: Thu Jun 24, 2004 12:19 pm    Post subject: Re: Panel1->ComponentCount returned 0 Why ? Reply with quote



Sam wrote:
Quote:
I a panel and droped on some buttons and checkBox.
I need to make a special process for all components that are owned by the
panel.
the propertie Panel1->ComponentCount contains always 0, why ?
Because those buttons are owned by the form and not by the panel. What

you have to use is the ControlCount and the Controls array.

Eelke

Back to top
Sam
Guest





PostPosted: Thu Jun 24, 2004 2:13 pm    Post subject: Re: Panel1->ComponentCount returned 0 Why ? Reply with quote



Thank you very much.

Sam
"Eelke Klein" <e.klein (AT) mplussoftware (DOT) nl> a écrit dans le message de
news:40dac6dc$1 (AT) newsgroups (DOT) borland.com...
Quote:
Sam wrote:
I a panel and droped on some buttons and checkBox.
I need to make a special process for all components that are owned by
the
panel.
the propertie Panel1->ComponentCount contains always 0, why ?
Because those buttons are owned by the form and not by the panel. What
you have to use is the ControlCount and the Controls array.

Eelke



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Jun 24, 2004 5:27 pm    Post subject: Re: Panel1->ComponentCount returned 0 Why ? Reply with quote


"Sam" <skneife3 (AT) wanadoo (DOT) fr> wrote


Quote:
I need to make a special process for all components that are
owned by the panel. the propertie Panel1->ComponentCount
contains always 0, why ?

Because the Panel does not own the components that are dropped onto it at
design time. The form itself does instead.

To loop through the components that visually appear on the Panel, use the
ControlCount and Controls[] properties instead.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.