Add an enhanced exTree ActiveX control to your application. exTree provides the entire range of capabilities you would expect to see in a state-of-the-art Tree component. The exTree control simulates a simple tree, a multi-column tree, a list or a listview control.

Dim h
With Extree1
With .Columns
.Add("C1")
.Add("C2")
.Add("C3")
End With
With .Items
h = .AddItem("Item 1")
.set_CellCaption(h,1,"SubItem 1.1")
.set_CellCaption(h,2,"SubItem 1.2")
Debug.Print( .get_CellCaption(h,0) )
End With
End With

487:

Is it possible to load child items when clicking the +/- button

' BeforeExpandItem event - Fired before an item is about to be expanded (collapsed).
Private Sub Extree1_BeforeExpandItem(ByVal sender As System.Object,ByVal Item As Integer,ByRef Cancel As Object) Handles Extree1.BeforeExpandItem
With Extree1
With .Items
.InsertItem(Item,,"new")
.set_ItemHasChildren(.InsertItem(Item,,"new"),True)
.InsertItem(Item,,"new")
End With
End With
End Sub
With Extree1
.LinesAtRoot = exontrol.EXTREELib.LinesAtRootEnum.exLinesAtRoot
.Columns.Add("Default")
With .Items
.set_ItemHasChildren(.AddItem("aka"),True)
.AddItem("next item")
End With
End With

How can I change the color, font, bold etc for the items/cells in the same column or for the entire column

With Extree1
.BeginUpdate()
.MarkSearchColumn = False
With .ConditionalFormats.Add("1")
.Bold = True
.ForeColor = Color.FromArgb(255,0,0)
.ApplyTo = &H1
End With
.Columns.Add("C1")
With .Columns.Add("C2")
.HeaderBold = True
.HTMLCaption = "<fgcolor=FF0000>C2"
End With
With .Items
.set_CellCaption(.AddItem(10),1,11)
.set_CellCaption(.AddItem(12),1,13)
End With
.EndUpdate()
End With

478:

The item is not getting selected when clicking the cell's checkbox. What should I do

' CellStateChanged event - Fired after cell's state has been changed.
Private Sub Extree1_CellStateChanged(ByVal sender As System.Object,ByVal Item As Integer,ByVal ColIndex As Integer) Handles Extree1.CellStateChanged
With Extree1
.Items.set_SelectItem(Item,True)
End With
End Sub
With Extree1
.Columns.Add("Check").set_Def(exontrol.EXTREELib.DefColumnEnum.exCellHasCheckBox,True)
With .Items
.AddItem(0)
.AddItem(1)
.AddItem(2)
.AddItem(3)
End With
End With

With Extree1
.BeginUpdate()
.LinesAtRoot = exontrol.EXTREELib.LinesAtRootEnum.exLinesAtRoot
.Columns.Add("Items")
With .Items
.AddItem("A")
.AddItem("B")
.InsertItem(.AddItem("C"),"","D")
.SetParent(.get_FindItem("D",0),.get_FindItem("A",0))
End With
.EndUpdate()
End With

459:

How can I change the identation for an item

With Extree1
.BeginUpdate()
.LinesAtRoot = exontrol.EXTREELib.LinesAtRootEnum.exLinesAtRoot
.Columns.Add("Items")
With .Items
.AddItem("A")
.AddItem("B")
.InsertItem(.AddItem("C"),"","D")
.SetParent(.get_FindItem("D",0),0)
End With
.EndUpdate()
End With

Is it possible to colour a particular column, I mean the cell's foreground color

With Extree1
.BeginUpdate()
With .ConditionalFormats.Add("1")
.ForeColor = Color.FromArgb(255,0,0)
.ApplyTo = &H1
End With
.MarkSearchColumn = False
With .Columns
.Add("Column 1")
.Add("Column 2")
End With
With .Items
.set_CellCaption(.AddItem(0),1,1)
.set_CellCaption(.AddItem(2),1,3)
.set_CellCaption(.AddItem(4),1,5)
End With
.EndUpdate()
End With

456:

Is it possible to colour a particular column for specified values

With Extree1
.BeginUpdate()
With .ConditionalFormats.Add("int(%1) in (3,4,5)")
.BackColor = Color.FromArgb(255,0,0)
.ApplyTo = &H1
End With
.MarkSearchColumn = False
With .Columns
.Add("Column 1")
.Add("Column 2")
End With
With .Items
.set_CellCaption(.AddItem(0),1,1)
.set_CellCaption(.AddItem(2),1,3)
.set_CellCaption(.AddItem(4),1,5)
End With
.EndUpdate()
End With

455:

Is it possible to colour a particular column

With Extree1
.BeginUpdate()
.MarkSearchColumn = False
With .Columns
.Add("Column 1")
.Add("Column 2").set_Def(exontrol.EXTREELib.DefColumnEnum.exCellBackColor,255)
End With
With .Items
.set_CellCaption(.AddItem(0),1,1)
.set_CellCaption(.AddItem(2),1,3)
.set_CellCaption(.AddItem(4),1,5)
End With
.EndUpdate()
End With

454:

How do i get all the children items that are under a certain parent Item handle

With Extree1
With .Columns.Add("Column")
.set_Def(exontrol.EXTREELib.DefColumnEnum.exCellHasCheckBox,True)
.set_Def(exontrol.EXTREELib.DefColumnEnum.exCellDrawPartsOrder,"caption,check")
End With
With .Items
.set_CellHasCheckBox(.AddItem("Caption 1"),0,True)
.set_CellHasCheckBox(.AddItem("Caption 2"),0,True)
End With
End With

450:

Can I change the order of the parts in the cell, as checkbox after the text, and so on

With Extree1
.BeginUpdate()
.FilterBarPromptVisible = True
.FilterBarCaption = "This is a bit of text being displayed in the filter bar."
.Columns.Add("")
With .Items
.AddItem("Item 1")
.AddItem("Item 2")
.AddItem("Item 3")
End With
.EndUpdate()
End With

441:

How can I find the number of items after filtering

Dim h
With Extree1
.BeginUpdate()
.Columns.Add("")
With .Items
h = .AddItem("")
.set_CellCaption(h,0,.VisibleItemCount)
End With
.EndUpdate()
End With