Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Delphi-News aus aller Welt (https://www.delphipraxis.net/58-delphi-news-aus-aller-welt/)
-   -   Do n.GetFirstChild=nil instead of n.Count=0 (https://www.delphipraxis.net/207405-do-n-getfirstchild%3Dnil-instead-n-count%3D0.html)

DP News-Robot 21. Mär 2021 16:30

Do n.GetFirstChild=nil instead of n.Count=0
 
I wish I knew this one sooner! If yo'uve worked with TTreeView before, and know about TTreeNode's HasChildren value, you need to check with OnExpanding, if you need to load the children or not. So I would typically have something like this:

if Node.HasChildren and (Node.Count=0) then //load children nodes Only now after all these years I happen to come past this in the Vcl.ComCtrls.pas unit:

function TTreeNode.GetCount: Integer;


Weiterlesen...


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:02 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz