Articles   Members Online: 3
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to check if a TTreeView is fully expanded or collapsed Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
31-Oct-02
Category
VCL-General
Language
Delphi 2.x
Views
136
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas

How to check if a TTreeView is fully expanded or collapsed

Answer:
1   
2   function IsTreeviewFullyExpanded(tv: TTreeview): Boolean;
3   var
4     node: TTreenode;
5   begin
6     Assert(Assigned(tv));
7     if tv.items.count > 0 then
8     begin
9       node := tv.Items[0];
10      Result := true;
11      while Result and Assigned(node) do
12      begin
13        Result := node.Expanded or not node.HasChildren;
14        node := node.GetNext;
15      end;
16    end
17    else
18      Result := false
19  end;
20  
21  function IsTreeviewFullyCollapsed(tv: TTreeview): Boolean;
22  var
23    node: TTreenode;
24  begin
25    Assert(Assigned(tv));
26    if tv.items.count > 0 then
27    begin
28      node := tv.Items[0];
29      Result := true;
30      while Result and Assigned(node) do
31      begin
32        Result := not (node.Expanded and node.HasChildren);
33        node := node.GetNext;
34      end;
35    end
36    else
37      Result := false
38  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC