PDA

View Full Version : Can you give me a sample to use the TreeView component ?


xportcn
01-05-2002, 01:41 AM
Don't tell me that there is a DEMO in the distribution of Delphi6 .I want a program that you created by yourself.Its
function is displaying the files and directories ,as the Windows Resource Explorer.If you have one,please send it to my mailbox : xportcn@sohu.com ! Thanks a lot !

DarkHorse
01-05-2002, 03:14 AM
Hi,

Drop a treeview component and try the following code. You will get an idea about how TreeView is working.

procedure TForm3.BitBtn2Click(Sender: TObject);
begin
TreeView1.Items.Clear;
TreeView1.Items.Add(TreeView1.Items.GetFirstNode,' 1');
TreeView1.Items.AddChild(TreeView1.Items[0],'11');
TreeView1.Items.Add(TreeView1.Items.GetFirstNode,' 2');
TreeView1.Items.AddChild(TreeView1.Items[2],'22');
TreeView1.Items.Add(TreeView1.Items.GetFirstNode,' 3');
TreeView1.Items.AddChild(TreeView1.Items[4],'33');
end

Hope this will help.

Thanx
Tomy.

BaraoZemo
01-05-2002, 03:31 AM
take a look at this samples...

http://www.torry.net/samples/samples/comp/saveprop.zip
http://www.torry.net/samples/samples/comp/exdbtree.zip

http://www.undu.com/LIBS/ACM.ZIP (have a sample that output to treeview)

[]s
BaRaoZeMo