#Define tvwFirst 0 #Define tvwLast 1 #Define tvwNext 2 #Define tvwPrevious 3 #Define tvwChild 4 Public oForm oForm = Createobject('myForm') oForm.Show() With oForm.Tree .Left = 10 .Top = 10 .Width = 200 .Height = 200 .Nodes.Add(,tvwFirst,"r1",'Region 1') .Nodes.Add(,tvwFirst,"r2",'Region 2') WITH .Nodes.Add('r1',tvwChild,"r1s1","R1 Series 1") .BackColor = RGB(0,0,255) .ForeColor = Rgb(255,255,0) Endwith WITH .Nodes.Add('r1',tvwChild,"r1s2","R1 Series 2") .BackColor = RGB(255,0,0) .ForeColor = Rgb(255,255,0) Endwith WITH .Nodes.Add('r2',tvwChild,"r2s1","R2 Series 1") .BackColor = RGB(0,0,255) .ForeColor = Rgb(255,255,0) Endwith WITH .Nodes.Add('r2',tvwChild,"r2s2","R2 Series 2") .BackColor = RGB(255,0,0) .ForeColor = Rgb(255,255,0) Endwith For Each oNode In .Nodes && Expand all nodes for easy view oNode.Expanded = .T. Endfor Endwith Define Class myForm As Form oNode= .Null. Add Object Tree As OleControl With ; Name = 'Tree',OleClass='MSComCtlLib.TreeCtrl' Procedure Init With This.tree .linestyle = 1 .Font.Name = 'Times New Roman' .Font.Size = 10 .indentation = 5 Endwith Endproc EnddefineCetin