Autor Beitrag
lord.paddington
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Di 20.02.07 18:09 
Hi!

Wie kann ich die Anzahl

1. der Items
2. der Subitems
3. der Subitems von Subitems

eines Treeviews ermitteln?


ein
ausblenden Delphi-Quelltext
1:
TreeView1.Items.Count					


ergibt bei mir die Anzahl von 186 bei realen 5 Mutterknoten

_________________
pfutsch ist hin und hin ist pfutsch
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 20.02.07 18:50 
Moin!

Da wirst du wohl den Baum durchlaufen müssen und selbst zählen. :roll: ;)

Z.B. ist bei einem TopLevel-Node die Eigenschaft .Parent = NIL, usw. usf. Rest -> DOH unter TTreeNode. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Di 20.02.07 18:51 
Hallo,

items :arrow: TreeView.Items.Count
Subitems :arrow: TreeView.Items[x].Count
Subitems von Subitems :arrow: rekursiv mit TreeView.Items[x].Count

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )