| View previous topic :: View next topic |
| Author |
Message |
Sam Guest
|
Posted: Thu Jun 24, 2004 11:52 am Post subject: Panel1->ComponentCount returned 0 Why ? |
|
|
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
|
Posted: Thu Jun 24, 2004 12:19 pm Post subject: Re: Panel1->ComponentCount returned 0 Why ? |
|
|
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
|
Posted: Thu Jun 24, 2004 2:13 pm Post subject: Re: Panel1->ComponentCount returned 0 Why ? |
|
|
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
|
Posted: Thu Jun 24, 2004 5:27 pm Post subject: Re: Panel1->ComponentCount returned 0 Why ? |
|
|
"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 |
|
 |
|