Page 1 of 1

AccordionTab->ComponentCount has wrong value

PostPosted: 25 Jul 2014 11:13
by JMiller
Hello!

I have an AccordionTab with another Accordion inside it, but when I check AccordionTab->ComponentCount is 0.
In another small project I checked the AccordionTab->ComponentCount, too. No matter what or how many components I put in there - it always has the value 1.

Can you confirm this?


Best regards,
Joe

Re: AccordionTab->ComponentCount has wrong value

PostPosted: 25 Jul 2014 11:23
by Jorge Sousa
Hi

Yes, we confirm this, and this is normal and alright.

The owner of any component will be the form or the frame, so only Form.ComponentCount or Frame.ComponentCount will change if you add/remove components.

What you're looking for is AccordionTab->ControlCount, not AccordionTab->ComponentCount

Re: AccordionTab->ComponentCount has wrong value

PostPosted: 25 Jul 2014 12:32
by JMiller
Thanks for the clarification.

So I should access these things via
AccordionTab->Controls[0]
instead of
AccordionTab->Components[0]
?

The later worked fine so far.

Re: AccordionTab->ComponentCount has wrong value

PostPosted: 25 Jul 2014 14:13
by Jorge Sousa
Hi

So I should access these things via
AccordionTab->Controls[0]
instead of
AccordionTab->Components[0]


Exactly, by the parent chain and not by ownership chain.

The later worked fine so far.


only if the applyed to a form or frame, since they are the owners.

All of this is true for any control in Delphi, including Windows controls, DevExpress PageControl per instance.

if you create controls at runtime and pass other owners than the form/frame, that is another history.