[Lazarus] TTabsheet componentcount property always seems to show 0

Paul Ishenin webpirat at mail.ru
Sun Nov 4 05:45:11 CET 2012



04.11.12, 2:10, Ajeandro Gonzalo пишет:
> Thank you, that works.  It's curious that componentcount compiles for the tabsheet in the first place.

TTabSheet can also own something. For example you can write the next code:

NewBtn := TButton.Create(TabSheet1);

After that a TabSheet1 will own a TButton and componentCount will show that.

At the same time you can place this button on another control:

NewBtn.Parent := TabSheet2;

Which result in showing of that Button on TabSheet2 which is owned by 
TabSheet1.

So TabSheet1.Components[] will contain NewBtn but TabSheet1.Controls[] 
will not have it and vice versa with TabSheet2.

Best regards,
Paul Ishenin




More information about the Lazarus mailing list