Envision Image Library
   Entire Site      Advanced 

Forum    Newest Components   Top 20 Downloads   Edit Comps/Apps   Tips   Chat   Books
TTreeView easy way to add item :)
    {
Here is a simple procedure that add Item in TreeView component
classed by level ... usefull for a "debug" ttreeview
}

{Add in the Public declaration}

DebugNode : Array [ 0..9 ] Of TTreeNode;
Procedure AddDebug ( Level : Integer; Text : String );

{Add between Implementation and End.}

Procedure TForm1.AddDebug ( Level : Integer; Text : String );
Begin
 If Level = 0 Then
   DebugNode [ 0 ] := TreeView1.Items.Add ( Nil, Text )
 Else
   DebugNode [ Level ] := TreeView1.Items.AddChild ( DebugNode [ Level - 1 ], Text );
End;
Author: Joel Vandal   WebPage: http://www.9bit.qc.ca/~jvandal/

Back Insert New Tip    Home