668:
Is it possible to change the caption from a column without to remove the column and add it with the new caption
Dim oTree as P
Dim var_Column as local
Dim var_Column1 as local

oTree = topparent:CONTROL_ACTIVEX1.activex
' oTree.Columns.Add("ColumnName").Caption = "NewName"
var_Column = oTree.Columns.Add("ColumnName")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.Caption = `NewName`"

' oTree.Columns.Add("ColumnName").HTMLCaption = "<b>New</b>Name"
var_Column1 = oTree.Columns.Add("ColumnName")
oTree.TemplateDef = "dim var_Column1"
oTree.TemplateDef = var_Column1
oTree.Template = "var_Column1.HTMLCaption = `<b>New</b>Name`"


667:
FilterBarCaption ALL Keyword ( sample 2, result )

' Occurs after a new Item has been inserted to Items collection.
function AddItem as v (Item  as  OLE::Exontrol.Tree.1::HITEM)
	Dim i as 
	Dim var_Items as local
	oTree = topparent:CONTROL_ACTIVEX1.activex
	i = oTree.FormatABC("value + 1",oTree.Items.ItemToIndex(Item))
	' oTree.Items.CellImage(Item,3) = i
	var_Items = oTree.Items
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellImage(Item,3) = i"

end function

Dim h as N
Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Column3 as P
Dim var_Column4 as P
Dim var_Column5 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
var_Column = oTree.Columns.Add("Col-1")
	var_Column.DisplayFilterButton = .t.
	var_Column.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column1 = oTree.Columns.Add("Col-2")
	var_Column1.DisplayFilterButton = .t.
	var_Column1.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column2 = oTree.Columns.Add("Check")
	' var_Column2.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column2"
	oTree.TemplateDef = var_Column2
	oTree.Template = "var_Column2.Def(0) = True"

	var_Column2.DisplayFilterButton = .t.
	var_Column2.DisplayFilterPattern = .f.
	var_Column2.FilterType = 6
var_Column3 = oTree.Columns.Add("Image")
	var_Column3.DisplayFilterButton = .t.
	var_Column3.FilterType = 10
	var_Column3.FilterList = 9472 'exShowExclude + exShowFocusItem + exShowCheckBox
var_Column4 = oTree.Columns.Add("Pos")
	var_Column4.AllowSizing = .f.
	var_Column4.AllowSort = .f.
	var_Column4.Width = 32
	var_Column4.FormatColumn = "1 apos ``"
	var_Column4.Position = 0
var_Items = oTree.Items
	' var_Items.CellCaption(var_Items.AddItem("Item A"),1) = "Sub-Item A"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item A`),1) = `Sub-Item A`"

	h = var_Items.AddItem("Item B")
	' var_Items.CellCaption(h,1) = "Sub-Item B"
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,1) = `Sub-Item B`"

	' var_Items.CellState(h,2) = 1
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellState(h,2) = 1"

	' var_Items.CellCaption(var_Items.AddItem("Item C"),1) = "Sub-Item C"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item C`),1) = `Sub-Item C`"

oTree.FilterBarFont = oTree.Font
oTree.Template = "Description(11) = FormatABC(```<fgcolor=808080> `` + value + `` </fgcolor>```,Description(11))" // oTree.Description(11) = oTree.FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree.Description(11))
oTree.FilterBarCaption = "(( ( all replace `[<b>` with `<bgcolor=000000><fgcolor=FFFFFF><b> ` replace `</b>]` with ` </b></bgcolor></fgcolor>` replace `[<s>` with `<bgcolor=C0C0C0><fgcolor=FFFFFF> ` replace `</s>]` with ` </fgcolor></bgcolor>` )  + `<r><fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : (`<r><fgcolor=808080>`+ itemcount + ` item(s)`) )))"
oTree.FilterBarPromptVisible = 3 'exFilterBarVisible + exFilterBarPromptVisible
var_Column5 = oTree.Columns.Item(0)
	var_Column5.FilterType = 240
	var_Column5.Filter = "Item A|Item B"
oTree.Columns.Item(2).Filter = 1
oTree.ApplyFilter()
oTree.EndUpdate()

666:
FilterBarCaption ALL Keyword ( sample 1 )

' Occurs after a new Item has been inserted to Items collection.
function AddItem as v (Item  as  OLE::Exontrol.Tree.1::HITEM)
	Dim i as 
	Dim var_Items as local
	oTree = topparent:CONTROL_ACTIVEX1.activex
	i = oTree.FormatABC("value + 1",oTree.Items.ItemToIndex(Item))
	' oTree.Items.CellImage(Item,3) = i
	var_Items = oTree.Items
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellImage(Item,3) = i"

end function

Dim h as N
Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Column3 as P
Dim var_Column4 as P
Dim var_Column5 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
var_Column = oTree.Columns.Add("Col-1")
	var_Column.DisplayFilterButton = .t.
	var_Column.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column1 = oTree.Columns.Add("Col-2")
	var_Column1.DisplayFilterButton = .t.
	var_Column1.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column2 = oTree.Columns.Add("Check")
	' var_Column2.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column2"
	oTree.TemplateDef = var_Column2
	oTree.Template = "var_Column2.Def(0) = True"

	var_Column2.DisplayFilterButton = .t.
	var_Column2.DisplayFilterPattern = .f.
	var_Column2.FilterType = 6
var_Column3 = oTree.Columns.Add("Image")
	var_Column3.DisplayFilterButton = .t.
	var_Column3.FilterType = 10
	var_Column3.FilterList = 9472 'exShowExclude + exShowFocusItem + exShowCheckBox
var_Column4 = oTree.Columns.Add("Pos")
	var_Column4.AllowSizing = .f.
	var_Column4.AllowSort = .f.
	var_Column4.Width = 32
	var_Column4.FormatColumn = "1 apos ``"
	var_Column4.Position = 0
var_Items = oTree.Items
	' var_Items.CellCaption(var_Items.AddItem("Item A"),1) = "Sub-Item A"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item A`),1) = `Sub-Item A`"

	h = var_Items.AddItem("Item B")
	' var_Items.CellCaption(h,1) = "Sub-Item B"
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,1) = `Sub-Item B`"

	' var_Items.CellState(h,2) = 1
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellState(h,2) = 1"

	' var_Items.CellCaption(var_Items.AddItem("Item C"),1) = "Sub-Item C"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item C`),1) = `Sub-Item C`"

oTree.FilterBarFont = oTree.Font
oTree.Template = "Description(11) = FormatABC(```<fgcolor=808080> `` + value + `` </fgcolor>```,Description(11))" // oTree.Description(11) = oTree.FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree.Description(11))
oTree.FilterBarCaption = "all"
oTree.FilterBarPromptVisible = 3 'exFilterBarVisible + exFilterBarPromptVisible
var_Column5 = oTree.Columns.Item(0)
	var_Column5.FilterType = 240
	var_Column5.Filter = "Item A|Item B"
oTree.Columns.Item(2).Filter = 1
oTree.ApplyFilter()
oTree.EndUpdate()

665:
FilterBarCaption ALLUI Keyword ( sample 2, result )

' Occurs after a new Item has been inserted to Items collection.
function AddItem as v (Item  as  OLE::Exontrol.Tree.1::HITEM)
	Dim i as 
	Dim var_Items as local
	oTree = topparent:CONTROL_ACTIVEX1.activex
	i = oTree.FormatABC("value + 1",oTree.Items.ItemToIndex(Item))
	' oTree.Items.CellImage(Item,3) = i
	var_Items = oTree.Items
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellImage(Item,3) = i"

end function

Dim h as N
Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Column3 as P
Dim var_Column4 as P
Dim var_Column5 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
var_Column = oTree.Columns.Add("Col-1")
	var_Column.DisplayFilterButton = .t.
	var_Column.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column1 = oTree.Columns.Add("Col-2")
	var_Column1.DisplayFilterButton = .t.
	var_Column1.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column2 = oTree.Columns.Add("Check")
	' var_Column2.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column2"
	oTree.TemplateDef = var_Column2
	oTree.Template = "var_Column2.Def(0) = True"

	var_Column2.DisplayFilterButton = .t.
	var_Column2.DisplayFilterPattern = .f.
	var_Column2.FilterType = 6
var_Column3 = oTree.Columns.Add("Image")
	var_Column3.DisplayFilterButton = .t.
	var_Column3.FilterType = 10
	var_Column3.FilterList = 9472 'exShowExclude + exShowFocusItem + exShowCheckBox
var_Column4 = oTree.Columns.Add("Pos")
	var_Column4.AllowSizing = .f.
	var_Column4.AllowSort = .f.
	var_Column4.Width = 32
	var_Column4.FormatColumn = "1 apos ``"
	var_Column4.Position = 0
var_Items = oTree.Items
	' var_Items.CellCaption(var_Items.AddItem("Item A"),1) = "Sub-Item A"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item A`),1) = `Sub-Item A`"

	h = var_Items.AddItem("Item B")
	' var_Items.CellCaption(h,1) = "Sub-Item B"
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,1) = `Sub-Item B`"

	' var_Items.CellState(h,2) = 1
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellState(h,2) = 1"

	' var_Items.CellCaption(var_Items.AddItem("Item C"),1) = "Sub-Item C"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item C`),1) = `Sub-Item C`"

oTree.FilterBarFont = oTree.Font
oTree.Template = "Description(11) = FormatABC(```<fgcolor=808080> `` + value + `` </fgcolor>```,Description(11))" // oTree.Description(11) = oTree.FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree.Description(11))
oTree.FilterBarCaption = "(( ( allui replace `[<b>` with `<bgcolor=000000><fgcolor=FFFFFF><b> ` replace `</b>]` with ` </b></bgcolor></fgcolor>` replace `[<s>` with `<bgcolor=C0C0C0><fgcolor=FFFFFF> ` replace `</s>]` with ` </fgcolor></bgcolor>` )  + `<r><fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : (`<r><fgcolor=808080>`+ itemcount + ` item(s)`) )))"
oTree.FilterBarPromptVisible = 3 'exFilterBarVisible + exFilterBarPromptVisible
var_Column5 = oTree.Columns.Item(0)
	var_Column5.FilterType = 240
	var_Column5.Filter = "Item A|Item B"
oTree.Columns.Item(2).Filter = 1
oTree.ApplyFilter()
oTree.EndUpdate()

664:
FilterBarCaption ALLUI Keyword ( sample 1 )

' Occurs after a new Item has been inserted to Items collection.
function AddItem as v (Item  as  OLE::Exontrol.Tree.1::HITEM)
	Dim i as 
	Dim var_Items as local
	oTree = topparent:CONTROL_ACTIVEX1.activex
	i = oTree.FormatABC("value + 1",oTree.Items.ItemToIndex(Item))
	' oTree.Items.CellImage(Item,3) = i
	var_Items = oTree.Items
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellImage(Item,3) = i"

end function

Dim h as N
Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Column3 as P
Dim var_Column4 as P
Dim var_Column5 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
var_Column = oTree.Columns.Add("Col-1")
	var_Column.DisplayFilterButton = .t.
	var_Column.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column1 = oTree.Columns.Add("Col-2")
	var_Column1.DisplayFilterButton = .t.
	var_Column1.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column2 = oTree.Columns.Add("Check")
	' var_Column2.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column2"
	oTree.TemplateDef = var_Column2
	oTree.Template = "var_Column2.Def(0) = True"

	var_Column2.DisplayFilterButton = .t.
	var_Column2.DisplayFilterPattern = .f.
	var_Column2.FilterType = 6
var_Column3 = oTree.Columns.Add("Image")
	var_Column3.DisplayFilterButton = .t.
	var_Column3.FilterType = 10
	var_Column3.FilterList = 9472 'exShowExclude + exShowFocusItem + exShowCheckBox
var_Column4 = oTree.Columns.Add("Pos")
	var_Column4.AllowSizing = .f.
	var_Column4.AllowSort = .f.
	var_Column4.Width = 32
	var_Column4.FormatColumn = "1 apos ``"
	var_Column4.Position = 0
var_Items = oTree.Items
	' var_Items.CellCaption(var_Items.AddItem("Item A"),1) = "Sub-Item A"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item A`),1) = `Sub-Item A`"

	h = var_Items.AddItem("Item B")
	' var_Items.CellCaption(h,1) = "Sub-Item B"
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,1) = `Sub-Item B`"

	' var_Items.CellState(h,2) = 1
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellState(h,2) = 1"

	' var_Items.CellCaption(var_Items.AddItem("Item C"),1) = "Sub-Item C"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item C`),1) = `Sub-Item C`"

oTree.FilterBarFont = oTree.Font
oTree.Template = "Description(11) = FormatABC(```<fgcolor=808080> `` + value + `` </fgcolor>```,Description(11))" // oTree.Description(11) = oTree.FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree.Description(11))
oTree.FilterBarCaption = "allui"
oTree.FilterBarPromptVisible = 3 'exFilterBarVisible + exFilterBarPromptVisible
var_Column5 = oTree.Columns.Item(0)
	var_Column5.FilterType = 240
	var_Column5.Filter = "Item A|Item B"
oTree.Columns.Item(2).Filter = 1
oTree.ApplyFilter()
oTree.EndUpdate()

663:
FilterBarCaption AVAILABLE Keyword ( sample 2, result )

' Occurs after a new Item has been inserted to Items collection.
function AddItem as v (Item  as  OLE::Exontrol.Tree.1::HITEM)
	Dim i as 
	Dim var_Items as local
	oTree = topparent:CONTROL_ACTIVEX1.activex
	i = oTree.FormatABC("value + 1",oTree.Items.ItemToIndex(Item))
	' oTree.Items.CellImage(Item,3) = i
	var_Items = oTree.Items
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellImage(Item,3) = i"

end function

Dim h as N
Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Column3 as P
Dim var_Column4 as P
Dim var_Column5 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
var_Column = oTree.Columns.Add("Col-1")
	var_Column.DisplayFilterButton = .t.
	var_Column.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column1 = oTree.Columns.Add("Col-2")
	var_Column1.DisplayFilterButton = .t.
	var_Column1.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column2 = oTree.Columns.Add("Check")
	' var_Column2.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column2"
	oTree.TemplateDef = var_Column2
	oTree.Template = "var_Column2.Def(0) = True"

	var_Column2.DisplayFilterButton = .t.
	var_Column2.DisplayFilterPattern = .f.
	var_Column2.FilterType = 6
var_Column3 = oTree.Columns.Add("Image")
	var_Column3.DisplayFilterButton = .t.
	var_Column3.FilterType = 10
	var_Column3.FilterList = 9472 'exShowExclude + exShowFocusItem + exShowCheckBox
var_Column4 = oTree.Columns.Add("Pos")
	var_Column4.AllowSizing = .f.
	var_Column4.AllowSort = .f.
	var_Column4.Width = 32
	var_Column4.FormatColumn = "1 apos ``"
	var_Column4.Position = 0
var_Items = oTree.Items
	' var_Items.CellCaption(var_Items.AddItem("Item A"),1) = "Sub-Item A"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item A`),1) = `Sub-Item A`"

	h = var_Items.AddItem("Item B")
	' var_Items.CellCaption(h,1) = "Sub-Item B"
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,1) = `Sub-Item B`"

	' var_Items.CellState(h,2) = 1
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellState(h,2) = 1"

	' var_Items.CellCaption(var_Items.AddItem("Item C"),1) = "Sub-Item C"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item C`),1) = `Sub-Item C`"

oTree.FilterBarFont = oTree.Font
oTree.Template = "Description(11) = FormatABC(```<fgcolor=808080> `` + value + `` </fgcolor>```,Description(11))" // oTree.Description(11) = oTree.FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree.Description(11))
oTree.FilterBarCaption = "(( ( value replace `[` with `<bgcolor=000000><fgcolor=FFFFFF><b> ` replace `]` with ` </b></bgcolor></fgcolor>` ) + ` ` + ( available replace `[` with `<bgcolor=C0C0C0><fgcolor=FFFFFF><b> ` replace `]` with ` </b></bgcolor></fgcolor>` replace `<s>` with `` replace `</s>` with `` ) + `<fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : (`<r><fgcolor=808080>`+ itemcount + ` item(s)`) )))"
oTree.FilterBarPromptVisible = 3 'exFilterBarVisible + exFilterBarPromptVisible
var_Column5 = oTree.Columns.Item(0)
	var_Column5.FilterType = 240
	var_Column5.Filter = "Item A|Item B"
oTree.Columns.Item(2).Filter = 1
oTree.ApplyFilter()
oTree.EndUpdate()

662:
FilterBarCaption AVAILABLE Keyword ( sample 1 )

' Occurs after a new Item has been inserted to Items collection.
function AddItem as v (Item  as  OLE::Exontrol.Tree.1::HITEM)
	Dim i as 
	Dim var_Items as local
	oTree = topparent:CONTROL_ACTIVEX1.activex
	i = oTree.FormatABC("value + 1",oTree.Items.ItemToIndex(Item))
	' oTree.Items.CellImage(Item,3) = i
	var_Items = oTree.Items
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellImage(Item,3) = i"

end function

Dim h as N
Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Column3 as P
Dim var_Column4 as P
Dim var_Column5 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
var_Column = oTree.Columns.Add("Col-1")
	var_Column.DisplayFilterButton = .t.
	var_Column.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column1 = oTree.Columns.Add("Col-2")
	var_Column1.DisplayFilterButton = .t.
	var_Column1.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column2 = oTree.Columns.Add("Check")
	' var_Column2.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column2"
	oTree.TemplateDef = var_Column2
	oTree.Template = "var_Column2.Def(0) = True"

	var_Column2.DisplayFilterButton = .t.
	var_Column2.DisplayFilterPattern = .f.
	var_Column2.FilterType = 6
var_Column3 = oTree.Columns.Add("Image")
	var_Column3.DisplayFilterButton = .t.
	var_Column3.FilterType = 10
	var_Column3.FilterList = 9472 'exShowExclude + exShowFocusItem + exShowCheckBox
var_Column4 = oTree.Columns.Add("Pos")
	var_Column4.AllowSizing = .f.
	var_Column4.AllowSort = .f.
	var_Column4.Width = 32
	var_Column4.FormatColumn = "1 apos ``"
	var_Column4.Position = 0
var_Items = oTree.Items
	' var_Items.CellCaption(var_Items.AddItem("Item A"),1) = "Sub-Item A"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item A`),1) = `Sub-Item A`"

	h = var_Items.AddItem("Item B")
	' var_Items.CellCaption(h,1) = "Sub-Item B"
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,1) = `Sub-Item B`"

	' var_Items.CellState(h,2) = 1
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellState(h,2) = 1"

	' var_Items.CellCaption(var_Items.AddItem("Item C"),1) = "Sub-Item C"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item C`),1) = `Sub-Item C`"

oTree.FilterBarFont = oTree.Font
oTree.Template = "Description(11) = FormatABC(```<fgcolor=808080> `` + value + `` </fgcolor>```,Description(11))" // oTree.Description(11) = oTree.FormatABC("`<fgcolor=808080> ` + value + ` </fgcolor>`",oTree.Description(11))
oTree.FilterBarCaption = "value + ` ` + available"
oTree.FilterBarPromptVisible = 3 'exFilterBarVisible + exFilterBarPromptVisible
var_Column5 = oTree.Columns.Item(0)
	var_Column5.FilterType = 240
	var_Column5.Filter = "Item A|Item B"
oTree.Columns.Item(2).Filter = 1
oTree.ApplyFilter()
oTree.EndUpdate()

661:
Is it possible to somehow highlight the column's name different than its filter value in the control's filter bar ( sample 3, results )

Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Column3 as P
Dim var_Column4 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Column = oTree.Columns.Add("Col-1")
	var_Column.DisplayFilterButton = .t.
	var_Column.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column1 = oTree.Columns.Add("Col-2")
	var_Column1.DisplayFilterButton = .t.
	var_Column1.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column2 = oTree.Columns.Add("Pos")
	var_Column2.AllowSizing = .f.
	var_Column2.AllowSort = .f.
	var_Column2.Width = 32
	var_Column2.FormatColumn = "1 apos ``"
	var_Column2.Position = 0
var_Items = oTree.Items
	' var_Items.CellCaption(var_Items.AddItem("Item A"),1) = "Sub-Item A"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item A`),1) = `Sub-Item A`"

	' var_Items.CellCaption(var_Items.AddItem("Item B"),1) = "Sub-Item B"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item B`),1) = `Sub-Item B`"

	' var_Items.CellCaption(var_Items.AddItem("Item C"),1) = "Sub-Item C"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item C`),1) = `Sub-Item C`"

oTree.FilterBarFont = oTree.Font
oTree.Template = "Description(11) = FormatABC(```<fgcolor=808080>`` + value + ``</fgcolor>```,Description(11))" // oTree.Description(11) = oTree.FormatABC("`<fgcolor=808080>` + value + `</fgcolor>`",oTree.Description(11))
oTree.FilterBarCaption = "(`<b>` + value + `</b><fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : (`<fgcolor=808080>`+ itemcount + ` item(s)`) )) replace `[` with `<bgcolor=000000><fgcolor=FFFFFF><b> ` replace `]` with ` </b></bgcolor></fgcolor>`"
oTree.FilterBarPromptVisible = 256
var_Column3 = oTree.Columns.Item(0)
	var_Column3.FilterType = 240
	var_Column3.Filter = "Item A|Item B"
var_Column4 = oTree.Columns.Item(1)
	var_Column4.FilterType = 3
	var_Column4.Filter = "*B"
oTree.ApplyFilter()
oTree.EndUpdate()

660:
Is it possible to somehow highlight the column's name different than its filter value in the control's filter bar ( sample 2 )

Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Column3 as P
Dim var_Column4 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Column = oTree.Columns.Add("Col-1")
	var_Column.DisplayFilterButton = .t.
	var_Column.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column1 = oTree.Columns.Add("Col-2")
	var_Column1.DisplayFilterButton = .t.
	var_Column1.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column2 = oTree.Columns.Add("Pos")
	var_Column2.AllowSizing = .f.
	var_Column2.AllowSort = .f.
	var_Column2.Width = 32
	var_Column2.FormatColumn = "1 apos ``"
	var_Column2.Position = 0
var_Items = oTree.Items
	' var_Items.CellCaption(var_Items.AddItem("Item A"),1) = "Sub-Item A"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item A`),1) = `Sub-Item A`"

	' var_Items.CellCaption(var_Items.AddItem("Item B"),1) = "Sub-Item B"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item B`),1) = `Sub-Item B`"

	' var_Items.CellCaption(var_Items.AddItem("Item C"),1) = "Sub-Item C"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item C`),1) = `Sub-Item C`"

oTree.FilterBarFont = oTree.Font
oTree.Template = "Description(11) = FormatABC(```<fgcolor=808080>`` + value + ``</fgcolor>```,Description(11))" // oTree.Description(11) = oTree.FormatABC("`<fgcolor=808080>` + value + `</fgcolor>`",oTree.Description(11))
oTree.FilterBarCaption = "value replace `[` with `<bgcolor=000000><fgcolor=FFFFFF><b> ` replace `]` with ` </b></bgcolor></fgcolor>`"
oTree.FilterBarPromptVisible = 256
var_Column3 = oTree.Columns.Item(0)
	var_Column3.FilterType = 240
	var_Column3.Filter = "Item A|Item B"
var_Column4 = oTree.Columns.Item(1)
	var_Column4.FilterType = 3
	var_Column4.Filter = "*B"
oTree.ApplyFilter()
oTree.EndUpdate()

659:
Is it possible to somehow highlight the column's name different than its filter value in the control's filter bar ( sample 1 )

Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Column3 as P
Dim var_Column4 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Column = oTree.Columns.Add("Col-1")
	var_Column.DisplayFilterButton = .t.
	var_Column.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column1 = oTree.Columns.Add("Col-2")
	var_Column1.DisplayFilterButton = .t.
	var_Column1.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column2 = oTree.Columns.Add("Pos")
	var_Column2.AllowSizing = .f.
	var_Column2.AllowSort = .f.
	var_Column2.Width = 32
	var_Column2.FormatColumn = "1 apos ``"
	var_Column2.Position = 0
var_Items = oTree.Items
	' var_Items.CellCaption(var_Items.AddItem("Item A"),1) = "Sub-Item A"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item A`),1) = `Sub-Item A`"

	' var_Items.CellCaption(var_Items.AddItem("Item B"),1) = "Sub-Item B"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item B`),1) = `Sub-Item B`"

	' var_Items.CellCaption(var_Items.AddItem("Item C"),1) = "Sub-Item C"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellCaption(AddItem(`Item C`),1) = `Sub-Item C`"

oTree.Template = "Description(11) = FormatABC(```<fgcolor=808080>`` + value + ``</fgcolor>```,Description(11))" // oTree.Description(11) = oTree.FormatABC("`<fgcolor=808080>` + value + `</fgcolor>`",oTree.Description(11))
oTree.FilterBarCaption = "value replace `[` with `<fgcolor=808080>[` replace `]` with `]</fgcolor>`"
oTree.FilterBarPromptVisible = 256
var_Column3 = oTree.Columns.Item(0)
	var_Column3.FilterType = 240
	var_Column3.Filter = "Item A|Item B"
var_Column4 = oTree.Columns.Item(1)
	var_Column4.FilterType = 3
	var_Column4.Filter = "*B"
oTree.ApplyFilter()
oTree.EndUpdate()

658:
Is it possible to automatically displays the control's filter label to the right

Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Column = oTree.Columns.Add("Item")
	var_Column.DisplayFilterButton = .t.
	var_Column.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarCaption = "`<r>` + value"
oTree.FilterBarPromptVisible = 1280 'exFilterBarShowCloseOnRight + exFilterBarToggle
var_Column2 = oTree.Columns.Item(0)
	var_Column2.FilterType = 240
	var_Column2.Filter = "Item B"
oTree.ApplyFilter()
oTree.EndUpdate()

657:
How can I get the number of results/items being shown in the control's filter bar (sample 4)

Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Column = oTree.Columns.Add("Item")
	var_Column.DisplayFilterButton = .t.
	var_Column.FilterList = 9504 'exShowExclude + exShowFocusItem + exShowCheckBox + exSortItemsAsc
var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarFont = oTree.Font
oTree.FilterBarPrompt = oTree.FormatABC("`<b>` + value",oTree.FilterBarPrompt)
oTree.FilterBarCaption = "`<b><r>` + value + `</b><fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `<br>` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : (`<fgcolor=808080>`+ itemcount + ` item(s)`) )"
oTree.FilterBarPromptVisible = 3591 'exFilterBarCompact + exFilterBarShowCloseOnRight + exFilterBarShowCloseIfRequired + exFilterBarCaptionVisible + exFilterBarVisible + exFilterBarPromptVisible
oTree.EndUpdate()

656:
How can I get the number of results being shown in the control's filter bar (sample 3)

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarFont = oTree.Font
oTree.FilterBarCaption = "`<b><r>` + value + `</b><fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `<br>` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : ``)"
oTree.FilterBarPromptVisible = 2055 'exFilterBarCompact + exFilterBarCaptionVisible + exFilterBarVisible + exFilterBarPromptVisible
var_Column2 = oTree.Columns.Item(0)
	var_Column2.FilterType = 240
	var_Column2.Filter = "Item A|Item B"
oTree.ApplyFilter()
oTree.EndUpdate()

655:
How can I get the number of results being shown in the control's filter bar (sample 2, compact)

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarFont = oTree.Font
oTree.FilterBarCaption = "`<b><r>` + value + `</b><fgcolor=808080>` + ( matchitemcount < 0 ? `<off -4> ` + abs(matchitemcount + 1) + ` result(s)` : ``)"
oTree.FilterBarPromptVisible = 2071 'exFilterBarCompact + exFilterBarSingleLine + exFilterBarCaptionVisible + exFilterBarVisible + exFilterBarPromptVisible
var_Column2 = oTree.Columns.Item(0)
	var_Column2.FilterType = 240
	var_Column2.Filter = "Item A|Item B"
oTree.ApplyFilter()
oTree.EndUpdate()

654:
How can I get the number of results being shown in the control's filter bar (sample 1)

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarFont = oTree.Font
oTree.FilterBarCaption = "`<b>` + value + `</b><r><fgcolor=808080>` + ( matchitemcount < 0 ? abs(matchitemcount + 1) + ` result(s)` : ``)"
oTree.FilterBarPromptVisible = 7 'exFilterBarCaptionVisible + exFilterBarVisible + exFilterBarPromptVisible
var_Column2 = oTree.Columns.Item(0)
	var_Column2.FilterType = 240
	var_Column2.Filter = "Item A|Item B"
oTree.ApplyFilter()
oTree.EndUpdate()

653:
FilterBarCaption Predefined Keywords

' Fired after an item is expanded (collapsed).
function AfterExpandItem as v (Item  as  OLE::Exontrol.Tree.1::HITEM)
	oTree = topparent:CONTROL_ACTIVEX1.activex
	oTree.Refresh()
end function

Dim h as N
Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Column3 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.LinesAtRoot = -1
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Check")
	' var_Column1.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column1"
	oTree.TemplateDef = var_Column1
	oTree.Template = "var_Column1.Def(0) = True"

	var_Column1.DisplayFilterButton = .t.
	var_Column1.DisplayFilterPattern = .f.
	var_Column1.FilterType = 6
var_Column2 = oTree.Columns.Add("Pos")
	var_Column2.AllowSizing = .f.
	var_Column2.AllowSort = .f.
	var_Column2.Width = 32
	var_Column2.FormatColumn = "1 apos ``"
	var_Column2.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	h = var_Items.AddItem("Item B")
	' var_Items.CellState(var_Items.InsertItem(h,,"Sub-Item B1"),1) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(InsertItem(h,,`Sub-Item B1`),1) = 1"

	var_Items.InsertItem(h,,"Sub-Item B2")
	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

	var_Items.AddItem("Item C")
oTree.FilterInclude = 1
oTree.FilterBarFont = oTree.Font
oTree.FilterBarCaption = "`<fgcolor=0000FF><i>value/current</i></fgcolor>: <fgcolor=808080>` + value + `</fgcolor>` + `<br><fgcolor=0000FF><i>available</i></fgcolor>: ` + available + `<br><fgcolor=0000FF><i>allui</i></fgcolor>: ` + allui + `<br><fgcolor=0000FF><i>all</i></fgcolor>: ` + all + `<br><fgcolor=0000FF><i>itemcount</i></fgcolor>: <fgcolor=808080>` + itemcount + `</fgcolor>`+ `<br><fgcolor=0000FF><i>visibleitemcount</i></fgcolor>: <fgcolor=808080>` + visibleitemcount + `</fgcolor>`+ `<br><fgcolor=0000FF><i>matchitemcount</i></fgcolor>: <fgcolor=808080>` + matchitemcount + `</fgcolor>`+ `<br><fgcolor=0000FF><i>promptpattern</i></fgcolor>: <fgcolor=808080>` + promptpattern + `</fgcolor>`"
oTree.FilterBarPromptPattern = "B"
oTree.FilterBarPromptVisible = 7 'exFilterBarCaptionVisible + exFilterBarVisible + exFilterBarPromptVisible
var_Column3 = oTree.Columns.Item(0)
	var_Column3.FilterType = 240
	var_Column3.Filter = "Item A|Item B"
oTree.ApplyFilter()
oTree.EndUpdate()

652:
I am using filter prompt feature, and also column's filter, just wondering if possible to compact displaying the filter bar so it won't show on multiple lines

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarFont = oTree.Font
oTree.FilterBarCaption = "`<r><i><fgcolor=808080><upline><solidline><sha ;;0>` + value"
oTree.FilterBarPromptPattern = "B"
oTree.FilterBarPromptVisible = 2067 'exFilterBarCompact + exFilterBarSingleLine + exFilterBarVisible + exFilterBarPromptVisible
var_Column2 = oTree.Columns.Item(0)
	var_Column2.FilterType = 240
	var_Column2.Filter = "Item A|Item B"
oTree.ApplyFilter()
oTree.EndUpdate()

651:
Just wondering if it is possible to show the filter bar's close button on the right ( sample 2 )

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarPromptVisible = 1281 'exFilterBarShowCloseOnRight + exFilterBarToggle + exFilterBarPromptVisible
oTree.FilterBarPrompt = oTree.FormatABC("`<r>` + value",oTree.FilterBarPrompt)
oTree.EndUpdate()

650:
Just wondering if it is possible to show the filter bar's close button on the right ( sample 1 )

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.RightToLeft = .t.
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarPromptVisible = 257 'exFilterBarToggle + exFilterBarPromptVisible
oTree.EndUpdate()

649:
How can I change the visual appearance of the filter bar's close button (EBN)

Dim oTree as P
Dim var_Appearance as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Appearance = oTree.VisualAppearance
	var_Appearance.Add(1,"gBFLBCJwBAEHhEJAAEhABHQDg6AADACAxRDgMQBQKAAzAJBIYhiG4cYCgMZhXDOCYXABCEYRXBIZQ7BKNIxjSJ5BhIAAyDSJMjSRJUEhqGCWYDleYYYAKHIMQLOg7IJjyI4/SJAYCydKAWhxIaZKJHCZoEDaTAADCNVAQp6MEIJVbVEI0e79OgBLp/Z7kECIJJAaRjHQdJxGLA8EhtCQhCZteK6SgMKJYXhWQYRXI1JwvMBrWrdQjiOYELQtMKmSZNLYGG4dR5SVJbcYhSYsRRFMoyDIOXYDLKsdYqSpXIThObEGgaPqJYjsUjCMKnR7HVIURrBPC9TBPE69ZgmC6ucKPX51ShKFaBWDZcwFAS+UBuYCAILiEAQGZ1XT8OROicbgJgSTJRlCaZeDsHY7QGR4xkSYp3CaExZAQMgalQYAwjCAAfBANxcA2TgKAUOpDCGFhKg0RpXCwCwDHQHQHEyAIkCkOhbFOGA8A8DohBgRg9AccZcn8EpEjMLI2C2DYxAgQgvAIUIVkoAAPBQDJlECTZ3CCYwDACQwUA8A5MCAWAWDiQi4l8aQOEgLJuBgBgDmYFAzEoIoIl0WALgKYJbBABADAAHgHg8VAMmqCQQDMXABAATYwTmNwBDATJXAiAgjHmNQ5lgQ5QEQEQMmcWg/GwD5ylyNw2gMcJcjsBgBgOQQDDhRpVAMMwnDBFw1B0Ax8D0DxOmmJJIGQTY5hGMAwkwM4CAYLZAmAOJnAqAojiIGg6iieYkmeAYOHaKJDCyCwjH6AoggsQpQliAJLhgaJ0CESBTnyDwjk+cg4g4P5IHIHJ+BWRRzlYWAxiOUxihsY4KjKLJRGqC44FCegkkkM58iAKAPnIWIWD8SRSFSfQnkmewUhYP4GiGKJ7G0TIbCSUoggqUo0lAQ4LnEcBcD8Coiiif4nE+eAAn2HpOkcFJqi4T5SkyMw/kqQown8IBIBOdA+A+DJrBqVxXEqYo4lCApLhGHBnD8S4ymyfxmg+cwQkQP5egOUZIWoEAkjIeIPBMBJBD+TBjBifwvkuc58hQJQPmFrYykkchclSApKjGOBuD+TRDFCfw3mmIxNi8FxFlOXhVC4aYDFyPgvg2YBcBcLZGCGCJ0DSLRzGSWQ/lmY5+mEP5gmMDBZRSMRsFsOxMhMJJ/DsTpTnwaQaE+N5ojuNhdEYNI5C4TZJO1GRDmCaxnA2Yx4n8IpIjOTBQBQC5TgyYw7gUYRYikC0BYRwsDQBoB8eA6Q2hsE0BUXgywZtYCyHMKwnxSAhAQHkIQhRrBaDsCwA4ERiB2EWAIYIXhhiVEgAEUYwwYjyASLge4FhHgRDkM8OQih0jWPkGgBBAQ")
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarPromptVisible = 257 'exFilterBarToggle + exFilterBarPromptVisible
oTree.Template = "Background(1) = 16777216" // oTree.Background(1) = 16777216
oTree.EndUpdate()

648:
How can I change the visual appearance of the filter bar's close button (solid)

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarPromptVisible = 1
oTree.Template = "Background(1) = 255" // oTree.Background(1) = 255
oTree.EndUpdate()

647:
Is it possible to prevent definitely showing the filter bar's close button

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarPromptVisible = 1
oTree.Template = "Background(1) = -1" // oTree.Background(1) = -1
oTree.EndUpdate()

646:
Is it possible to show the close button only if there is a filter applied

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarPromptVisible = 513 'exFilterBarShowCloseIfRequired + exFilterBarPromptVisible
oTree.EndUpdate()

645:
The control's filter bar is not closed once I click the close button (toggle)

Dim h as N
Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
	' var_Items.LockedItemCount(2) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.LockedItemCount(2) = 1"

	h = var_Items.LockedItem(2,0)
	' var_Items.ItemDivider(h) = 0
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ItemDivider(h) = 0"

	' var_Items.CellCaption(h,0) = "<c><fgcolor=808080>Press the CTRL + F to turn on/off the control's filter bar. ALT + Up/Down moves the focus."
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,0) = `<c><fgcolor=808080>Press the CTRL + F to turn on/off the control's filter bar. ALT + Up/Down moves the focus.`"

	' var_Items.CellCaptionFormat(h,0) = 1
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaptionFormat(h,0) = 1"

oTree.FilterBarCaption = "`<r><fgcolor=808080>` + value"
oTree.FilterBarPromptPattern = "B"
oTree.FilterBarPromptVisible = 2323 'exFilterBarCompact + exFilterBarToggle + exFilterBarSingleLine + exFilterBarVisible + exFilterBarPromptVisible
var_Column2 = oTree.Columns.Item(0)
	var_Column2.FilterType = 240
	var_Column2.Filter = "Item B"
oTree.ApplyFilter()
oTree.EndUpdate()

644:
How can I display the control's filter on a single line

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarCaption = "len(value) ? `filter for: <fgcolor 808080>` + value  : `<fgcolor 808080>no filter`"
oTree.FilterBarPromptVisible = 18 'exFilterBarSingleLine + exFilterBarVisible
var_Column2 = oTree.Columns.Item(0)
	var_Column2.FilterType = 240
	var_Column2.Filter = "Item A|Item B"
oTree.ApplyFilter()
oTree.EndUpdate()

643:
How can I display the control's filter on a single line (prompt-combined)

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarCaption = "`<r>` + value"
oTree.FilterBarPromptVisible = 2067 'exFilterBarCompact + exFilterBarSingleLine + exFilterBarVisible + exFilterBarPromptVisible
var_Column2 = oTree.Columns.Item(0)
	var_Column2.FilterType = 240
	var_Column2.Filter = "Item A|Item B"
oTree.ApplyFilter()
oTree.EndUpdate()

642:
How can I get the number of results after a filter is applied

' Occurs when the user presses and then releases the left mouse button over the tree control.
function Click as v ()
	oTree = topparent:CONTROL_ACTIVEX1.activex
	oTree.ClearFilter()
end function

' Notifies your application that the filter is changed.
function FilterChange as v ()
	oTree = topparent:CONTROL_ACTIVEX1.activex
	? "Items.MatchItemCount" 
	? oTree.Items.MatchItemCount 
	? oTree.FormatABC("value < 0 ? `filter applied: ` + abs(value + 1) + ` result(s)` : `no filter`",oTree.Items.MatchItemCount) 
end function

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarPromptVisible = 1
oTree.FilterBarPromptPattern = "Item"
oTree.EndUpdate()

641:
How can I programmatically clear the control's filter

' Occurs when the user presses and then releases the left mouse button over the tree control.
function Click as v ()
	oTree = topparent:CONTROL_ACTIVEX1.activex
	oTree.ClearFilter()
end function

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarPromptVisible = 1
oTree.FilterBarPromptPattern = "B"
oTree.EndUpdate()

640:
Is it possible to prevent closing the control's filter bar, so it is always shown (prompt-combined)

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarPromptPattern = "B"
oTree.FilterBarPromptVisible = 3 'exFilterBarVisible + exFilterBarPromptVisible
var_Column2 = oTree.Columns.Item(0)
	var_Column2.FilterType = 240
	var_Column2.Filter = "Item B"
oTree.ApplyFilter()
oTree.EndUpdate()

639:
Is it possible to prevent closing the control's filter bar, so it is always shown (prompt)

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarPromptVisible = 1
oTree.FilterBarPromptPattern = "B"
oTree.EndUpdate()

638:
Is it possible to prevent closing the control's filter bar, so it is always shown

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
' oTree.Columns.Add("Item").DisplayFilterButton = .t.
var_Column = oTree.Columns.Add("Item")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.DisplayFilterButton = True"

var_Column1 = oTree.Columns.Add("Pos")
	var_Column1.AllowSizing = .f.
	var_Column1.AllowSort = .f.
	var_Column1.Width = 32
	var_Column1.FormatColumn = "1 apos ``"
	var_Column1.Position = 0
var_Items = oTree.Items
	var_Items.AddItem("Item A")
	var_Items.AddItem("Item B")
	var_Items.AddItem("Item C")
oTree.FilterBarCaption = "len(value) = 0 ? `<fgcolor=808080>no filter` : value"
oTree.FilterBarPromptVisible = 2
var_Column2 = oTree.Columns.Item(0)
	var_Column2.FilterType = 240
	var_Column2.Filter = "Item B"
oTree.ApplyFilter()
oTree.EndUpdate()

637:
How can I change the visual appearance of the +/- buttons, open/close glyphs as current visual theme (method 4)

Dim h as N
Dim oTree as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.LinesAtRoot = -1
oTree.VisualDesign = "gBFLBWIgBAEHhEJAEGg6VAkHeLpgwChAOhULB8XAUUg8MAAREEHGMcgRCJ0ei8dhABDEcQAAYAQGKIYBkAKBQAGaAoDDMOQwQwAAxjGKEEwsACEIrjKCRShyCYZRhGcTSBCIZBqEqSZLiEZRQiiCYsS5GQBRWAkEwiBiEQTjea5CgOIAFS7LIqjRQEBxhIaZYIGaiQADENo9TxIMZAfBIHShK6NJABCCSQKkYx0HScRijDIEFwGIQmbKiej4DCiCQQW7OYYRVCNMQSfa8HivJyrcamfp/YBgOBYHb1eLVPR5LwfPCGUw1P6PLxkORZHimK4tSLHV7xVpMIwZFafIQhCCoHomS5NU7UNR0TQUFx9FaGX7rDDsGwLAJ6XRgF4bg2VpnHePpenAN4bH2GwHFmApSjEGBLnWOpRGOTBZHOegrE6BxPiWVJqCweQrn0LgJAWJBjwgaw1gKO5HmWch5h+fovF+G5bmich4BgfZkB8dynRUVYqiUR5rnmex/F6N4tn2AJfnebZ3DEXw3HWXgzAyIwgicKJKBKEIhCeCgiHyHYFEmSAFmqBghFIdgSCeIJygYDAyAgJx6AoIINAMOJNCgCZCGoGoLmMCI+CwJoihMNglCCIhzFCUg0EmMhghWDBkAiQg9CUY4jEYN4Jk2IxklYJoJHIUg+CSZJSESFwkkkGI+FOFIJEIRhPhMCRJCSVoRrSBhiDgTZjHYT4PEkYhwhgJYm0SaIaiaSYuE+GQNlmCIBGCJxjhiZQ5AkMhAg6ExJCkPhPguaAiFYUAlAkKZ0g6HoOEmWR/GHcA4m0OwIlIJIHCRgQshGJhpjoaocieaZiC6GAimkUgehIOwnGYGYIGkah6jaE4rg6SpCjKK5rEOMYlGIGIihKOggloFoqj6L5aGaBo6CkGIkAQjiPpCAAaJILCTJQlKPACDaXJgmSaJsnCdJ4nygKEoijKQpSmKcqCpKoqysK0rivLAsSyLMtC1LYty4Lkui7LwvS+L8wDBMIwzEMUxjHMgyTKMszDNM4zzQNE0jTNQ1TWNc2DZNo2zcN03jfOA4TiOM5DlOY5zoOk6jrOw7TuO88DxPI8z0PU9j3Pg+T6Ps/D9P4/0AQFAkDQRBUGQdCEJQpC0MQ1DkPRBEUSRNFEVBhFkXRhGQ9D6Dxfh+W5gGGd4QH2XQjCmDpFFaKoVB+D5Xmed5+H8YAHnIAh9EwV5Fl0d4MkMKJICmSgygSJAoEmMUCIPgnDCCIOQFYCxJjwFoCcA4kxoF+AIJkAgExegDEgEYQInAzCUAIOEGgfxiiRDYF1Q4EQ2BSCaEQYwbAiKREMpRSymFNDIAkAxT6oVRgSA2qdVKq1WqvVirMZQUhSCnBUMoIgoQRgnGSIQUgkg1hIHYAkAYMROAmHiLsE4xxSCxBwEwCQ0wmDdBsE0GYXBtg2CSPMFIuwYiQBYBQeAcwOCnBCCZgw0g0glBONAQgqQThCGgPQGoBQfiRGmOEZIPAXjsBoPAO4HRThhA0EQSA5BAgaCKJIGg3QdhOCmNUBoQAijTCIF0FwQxpCHDIPAYYMQGgtCmFcaQtRAjZCyFYSojQ2B2BoKwIYFApBXEIBsIQ1QsAWAWEwaA1xCgjAoIAQBAQ="
oTree.Columns.Add("Column")
var_Items = oTree.Items
	h = var_Items.AddItem("Root 1")
	var_Items.InsertItem(h,,"Child 1")
	var_Items.InsertItem(h,,"Child 2")
	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

	h = var_Items.AddItem("Root 2")
	var_Items.InsertItem(h,,"Child")
oTree.EndUpdate()

636:
How can I change the visual appearance of the +/- buttons, open/close glyphs as current visual theme (method 3)

Dim h as N
Dim oTree as P
Dim var_Appearance as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Appearance = oTree.VisualAppearance
	var_Appearance.Add(3,"gBFLBCJwBAEHhEJAAEhABDwCg6AADACAxRDgMQBQKAAzAJBIYhiG4cYCgMZhXDOCYXABCEYRXBIZQ7BKNIxjSJ5BhIAAyDSJMjSRJUEhqGCWYDleYYYAKHIMQLJQKQSBcQR9EaBZBAWTpQC0OJDTJRI4TNAgbSYAAYRqoCb6loTKypaxjCQQIgkUBpGKdBynEYsDwSGyJCCJWyIbpKAwoVbcs4AYhuJpaQi+d5PFbjVT8dLAMBwLA8EwXAJ+OpfDxXU7eFKpR5fchXTI8UxXFqXZhkeQrfh7KYVRBKdBQRBEFQPJqnahqOpaXo2RoLUJKcQwHTmHYNQTALyuTALZrWeZ3XrgN74LbtZzVQauYRpbCMEr6bpoWLnFi6Ho1U4llWah1jqSweFqfxPgQQRphi+Yak0YIuqUfJegef4zluaJ3nqPJeCYH4BAeX5TDLBpVGqKRRnwf4flefZtHsX54BYAR/F+EwVnUd5eAMMJKDIChygyIQpAoEh4iIJ5JlgXIcgCXpIGoFwnGEQh6BEKBgmMIICHgIJCAiUAzgyUoAhwJohkiRgygwYpiGoKwzGIcgKCkNQNCMRIbCYCRYk4QoMiOchWDwNBjhiJJaDYTRiGiFwlCQAhOE8JBJHITIRgwZRZFCFCZBkOIUhKTRpCWAwgGYQ4El4NxlBifIWCcCYCFoaoMGaKYyG6GxlBmGJdhkCAWBIeA5g4U4QhMJAImkPIShRVxGgQJRlCIUISh+SJpnCZIeBgFgiHgO4OlOMINCISByECDQikkGhuh2JwpmqBogCKaYiC6FwhmkQ4yHgYgYiaHopiuaRakCbIsisSpGjYOwaHYKYMCkK5CA2IxrCwCwFigaJrkLTI6lcdANAEgIA=")
	var_Appearance.Add(1,"CP:3 -2 -2 2 2")
	var_Appearance.Add(4,"gBFLBCJwBAEHhEJAAEhABEICg6AADACAxRDgMQBQKAAzAJBIYhiG4cYCgMZhXDOCYXABCEYRXBIZQ7BKNIxjSJ5BhIAAyDSJMjSRJUEhqGCWYDleYYYAKHIMQLJQKQSBcQR9EaBZBAWTpQC0OJDTJRI4TNAgbSYAAYRqoCb6loTKypaxjCQQIgkUBpGKdBynEYsDwSGyJCCJWyIbpKAwoVbcs4AYhuJpaQi+d5PFbjVT8dLAMBwLA8EwXAJ+OpfDxXU7eFKpR5fchXTI8UxXFqXZhkeQrfh7KYVRBKdBQRBEFQPJqnahqOpaXo2RoLUJKcQwHTmHYNQTALyuTALZrWeZ3XrgN74LbtZzVQauYRpbCMEr6bpoWLnFi6Ho1U4llWah1jqSweFqfxPgQQRphi+Yak0YIuqUfJeg8X4rluaZ3niGB+AQHx/EyShjjEVYqiUR5rnmex/GAB5+AIf4gEeXJFHyXZ3gCTAygyAociMKBKEKBIeCiCZyHYFAnCEeBkh+BghFgRIegOCgYCySAgh4CAkgINAMmMNIgCcCYjn4LoLmMCJGDKC5ijIagoDMYhCAoJg1A0IxEhsJgJFiThChCY5yFYPA0GOGIYloNhNGIaIXCUJACE4TwkEkchOFSFYlFkXhUCUCQZEYTglCSMxaEkYJIBmFJhDeDZZEYPwlgmQhghaGqVDoa4bGaeY6FGGZNlmFIBGEJ4jhiZQ5AkMhAg6E5JCkRoGCUSQ6B6CYiSCBIOh+DhJmmARiWQOJtDsCJSCSBwkXSLIRicaZ6HqIIomoIguhwIpphIHoWDsJ4mCGChpmqOpGheLIOkqUo2iya4DjGJxihiQoSj4IJaDaMpCjCWoGg6PgpBiQ4tHcQJQBAgI=")
	var_Appearance.Add(2,"CP:4 -2 -2 2 2")
oTree.LinesAtRoot = 1
oTree.HasButtons = 4
oTree.Template = "HasButtonsCustom(0) = 16777216" // oTree.HasButtonsCustom(.f.) = 16777216
oTree.Template = "HasButtonsCustom(1) = 33554432" // oTree.HasButtonsCustom(.t.) = 33554432
oTree.Columns.Add("Column")
var_Items = oTree.Items
	h = var_Items.AddItem("Root 1")
	var_Items.InsertItem(h,,"Child 1")
	var_Items.InsertItem(h,,"Child 2")
	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

	h = var_Items.AddItem("Root 2")
	var_Items.InsertItem(h,,"Child")
oTree.EndUpdate()

635:
How can I change the visual appearance of the +/- buttons, open/close glyphs as current visual theme (method 2)

Dim h as N
Dim oTree as P
Dim var_Appearance as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Appearance = oTree.VisualAppearance
	var_Appearance.Add(1,"XP:TREEVIEW 2 1")
	var_Appearance.Add(2,"XP:TREEVIEW 2 2")
oTree.Template = "Background(180) = 16777216" // oTree.Background(180) = 16777216
oTree.Template = "Background(181) = 33554432" // oTree.Background(181) = 33554432
oTree.LinesAtRoot = -1
oTree.Columns.Add("Column")
var_Items = oTree.Items
	h = var_Items.AddItem("Root 1")
	var_Items.InsertItem(h,,"Child 1")
	var_Items.InsertItem(h,,"Child 2")
	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

	h = var_Items.AddItem("Root 2")
	var_Items.InsertItem(h,,"Child")
oTree.EndUpdate()

634:
How can I find if the control is running in DPI mode
Dim oTree as P

oTree = topparent:CONTROL_ACTIVEX1.activex
? oTree.FormatABC("dpi = 1 ? `normal/stretch mode` : `dpi mode`") 

633:
How can I change the visual appearance of the +/- buttons (method 1)

Dim h as N
Dim oTree as P
Dim var_Appearance as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Appearance = oTree.VisualAppearance
	var_Appearance.Add(1,"gBFLBCJwBAEHhEJAAEhABDwCg6AADACAxRDgMQBQKAAzAJBIYhiG4cYCgMZhXDOCYXABCEYRXBIZQ7BKNIxjSJ5BhIAAyDSJMjSRJUEhqGCWYDleYYYAKHIMQLJQKQSBcQR9EaBZBAWTpQC0OJDTJRI4TNAgbSYAAYRqoCb6loTKypaxjCQQIgkUBpGKdBynEYsDwSGyJCCJWyIbpKAwoVbcs4AYhuJpaQi+d5PFbjVT8dLAMBwLA8EwXAJ+OpfDxXU7eFKpR5fchXTI8UxXFqXZhkeQrfh7KYVRBKdBQRBEFQPJqnahqOpaXo2RoLUJKcQwHTmHYNQTALyuTALZrWeZ3XrgN74LbtZzVQauYRpbCMEr6bpoWLnFi6Ho1U4llWah1jqSweFqfxPgQQRphi+Yak0YIuqUfJegef4zluaJ3nqPJeCYH4BAeX5TDLBpVGqKRRnwf4flefZtHsX54BYAR/F+EwVnUd5eAMMJKDIChygyIQpAoEh4iIJ5JlgXIcgCXpIGoFwnGEQh6BEKBgmMIICHgIJCAiUAzgyUoAhwJohkiRgygwYpiGoKwzGIcgKCkNQNCMRIbCYCRYk4QoMiOchWDwNBjhiJJaDYTRiGiFwlCQAhOE8JBJHITIRgwZRZFCFCZBkOIUhKTRpCWAwgGYQ4El4NxlBifIWCcCYCFoaoMGaKYyG6GxlBmGJdhkCAWBIeA5g4U4QhMJAImkPIShRVxGgQJRlCIUISh+SJpnCZIeBgFgiHgO4OlOMINCISByECDQikkGhuh2JwpmqBogCKaYiC6FwhmkQ4yHgYgYiaHopiuaRakCbIsisSpGjYOwaHYKYMCkK5CA2IxrCwCwFigaJrkLTI6lcdANAEgIA=")
	var_Appearance.Add(2,"gBFLBCJwBAEHhEJAAEhABEICg6AADACAxRDgMQBQKAAzAJBIYhiG4cYCgMZhXDOCYXABCEYRXBIZQ7BKNIxjSJ5BhIAAyDSJMjSRJUEhqGCWYDleYYYAKHIMQLJQKQSBcQR9EaBZBAWTpQC0OJDTJRI4TNAgbSYAAYRqoCb6loTKypaxjCQQIgkUBpGKdBynEYsDwSGyJCCJWyIbpKAwoVbcs4AYhuJpaQi+d5PFbjVT8dLAMBwLA8EwXAJ+OpfDxXU7eFKpR5fchXTI8UxXFqXZhkeQrfh7KYVRBKdBQRBEFQPJqnahqOpaXo2RoLUJKcQwHTmHYNQTALyuTALZrWeZ3XrgN74LbtZzVQauYRpbCMEr6bpoWLnFi6Ho1U4llWah1jqSweFqfxPgQQRphi+Yak0YIuqUfJeg8X4rluaZ3niGB+AQHx/EyShjjEVYqiUR5rnmex/GAB5+AIf4gEeXJFHyXZ3gCTAygyAociMKBKEKBIeCiCZyHYFAnCEeBkh+BghFgRIegOCgYCySAgh4CAkgINAMmMNIgCcCYjn4LoLmMCJGDKC5ijIagoDMYhCAoJg1A0IxEhsJgJFiThChCY5yFYPA0GOGIYloNhNGIaIXCUJACE4TwkEkchOFSFYlFkXhUCUCQZEYTglCSMxaEkYJIBmFJhDeDZZEYPwlgmQhghaGqVDoa4bGaeY6FGGZNlmFIBGEJ4jhiZQ5AkMhAg6E5JCkRoGCUSQ6B6CYiSCBIOh+DhJmmARiWQOJtDsCJSCSBwkXSLIRicaZ6HqIIomoIguhwIpphIHoWDsJ4mCGChpmqOpGheLIOkqUo2iya4DjGJxihiQoSj4IJaDaMpCjCWoGg6PgpBiQ4tHcQJQBAgI=")
oTree.LinesAtRoot = -1
oTree.Template = "Background(180) = 16777216" // oTree.Background(180) = 16777216
oTree.Template = "Background(181) = 33554432" // oTree.Background(181) = 33554432
oTree.Columns.Add("Column")
var_Items = oTree.Items
	h = var_Items.AddItem("Root 1")
	var_Items.InsertItem(h,,"Child 1")
	var_Items.InsertItem(h,,"Child 2")
	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

	h = var_Items.AddItem("Root 2")
	var_Items.InsertItem(h,,"Child")
oTree.EndUpdate()

632:
I am using single selection, the question is if possible to select an item only when the user releases the mouse, as currently it selects the item as soon as the user clicks it
' Fired after a new item has been selected.
function SelectionChanged as v ()
	oTree = topparent:CONTROL_ACTIVEX1.activex
	? "SelectionChanged" 
end function

Dim oTree as P
Dim var_Column as local
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.FreezeEvents(.t.)
oTree.SingleSel = .t.
oTree.SelectOnRelease = .t.
' oTree.Columns.Add("Column").FormatColumn = "1 apos `A-Z`"
var_Column = oTree.Columns.Add("Column")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.FormatColumn = `1 apos ``A-Z```"

var_Items = oTree.Items
	var_Items.AddItem("")
	' var_Items.SelectItem(var_Items.AddItem("")) = .t.
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.SelectItem(AddItem(``)) = True"

	var_Items.AddItem("")
oTree.FreezeEvents(.f.)
oTree.EndUpdate()

631:
Is it possible to select nothing
' Fired after a new item has been selected.
function SelectionChanged as v ()
	oTree = topparent:CONTROL_ACTIVEX1.activex
	? "SelectionChanged" 
end function

Dim oTree as P
Dim var_Column as local
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.FreezeEvents(.t.)
oTree.AllowSelectNothing = .t.
' oTree.Columns.Add("Column").FormatColumn = "1 apos `A-Z`"
var_Column = oTree.Columns.Add("Column")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.FormatColumn = `1 apos ``A-Z```"

var_Items = oTree.Items
	var_Items.AddItem("")
	' var_Items.SelectItem(var_Items.AddItem("")) = .t.
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.SelectItem(AddItem(``)) = True"

	var_Items.AddItem("")
oTree.FreezeEvents(.f.)
oTree.EndUpdate()

630:
How can I specify the color for control's selection when it loses the focus

Dim oTree as P
Dim var_Column as P
Dim var_Column1 as local
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Column = oTree.Columns.Add("")
	var_Column.AllowSizing = .f.
	var_Column.AllowDragging = .f.
	var_Column.AllowSort = .f.
	var_Column.Width = 24
	' var_Column.Def(2) = .t.
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(2) = True"

' oTree.Columns.Add("Column").FormatColumn = "1 apos `A-Z`"
var_Column1 = oTree.Columns.Add("Column")
oTree.TemplateDef = "dim var_Column1"
oTree.TemplateDef = var_Column1
oTree.Template = "var_Column1.FormatColumn = `1 apos ``A-Z```"

var_Items = oTree.Items
	var_Items.AddItem("")
	' var_Items.SelectItem(var_Items.AddItem("")) = .t.
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.SelectItem(AddItem(``)) = True"

	var_Items.AddItem("")
oTree.Template = "Background(166) = 12895428" // oTree.Background(166) = 12895428
oTree.Template = "Background(167) = 65536" // oTree.Background(167) = 65536
oTree.EndUpdate()

629:
How can I change the background color for checked items (EBN color, frame)

' Fired after cell's state has been changed.
function CellStateChanged as v (Item  as  OLE::Exontrol.Tree.1::HITEM,ColIndex  as  N)
	oTree = topparent:CONTROL_ACTIVEX1.activex
	oTree.Refresh()
end function

Dim h as N
Dim hChild as N
Dim oTree as P
Dim var_Appearance as P
Dim var_Column as P
Dim var_ConditionalFormat as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.LinesAtRoot = -1
oTree.SelBackMode = 1
oTree.DefaultItemHeight = 22
var_Column = oTree.Columns.Add("Tasks")
	' var_Column.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(0) = True"

	var_Column.PartialCheck = .t.
var_Appearance = oTree.VisualAppearance
	var_Appearance.Add(2,"gBFLBCJwBAEHhEJAAEhABUkIQAAYAQGKIcBiAKBQAGYBIJDEMQ3DjAUBjMK4ZwTC4AIQjCK4JDKHYJRpHEZgLBMJAAGIZYhhUYRUiYMkiJBGGDIDiGGI2SJAcbTVIEcx9EyUJSgSTJOjCMokTTIU4TTLYASbJafJJhWSaAiyMouDIOMg1BDNIw/Hika6jOgKUisNJXRzWIBTbDlOQ3JqnbCjOQRSrQBoNDAMAiiaKlbwJPK9RoieQXfwUAJrXJcFqXFSLVxNBKAQEBA=")
	var_Appearance.Add(1,"CP:2 1 1 -1 -1")
var_ConditionalFormat = oTree.ConditionalFormats.Add("%CS0 = 1")
	var_ConditionalFormat.BackColor = 16777216
oTree.HeaderVisible = .t.
var_Items = oTree.Items
	h = var_Items.AddItem("Project")
	hChild = var_Items.InsertItem(h,,"Task 1")
	' var_Items.SelectItem(hChild) = .t.
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.SelectItem(hChild) = True"

	hChild = var_Items.InsertItem(h,,"Task 2")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	hChild = var_Items.InsertItem(h,,"Task 3")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

oTree.EndUpdate()

628:
How can I change the caption of the checked items (sample 2)

Dim h as N
Dim hChild as N
Dim oTree as P
Dim var_Column as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.LinesAtRoot = -1
var_Column = oTree.Columns.Add("Tasks")
	' var_Column.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(0) = True"

	var_Column.PartialCheck = .t.
	' var_Column.Def(17) = 1
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(17) = 1"

	var_Column.FormatColumn = "%CS0 = 1 ? `<bgcolor=000000><fgcolor=FFFFFF> ` + value + ` </fgcolor></bgcolor>` : value"
oTree.HeaderVisible = .t.
var_Items = oTree.Items
	h = var_Items.AddItem("Project")
	hChild = var_Items.InsertItem(h,,"Task 1")
	' var_Items.SelectItem(hChild) = .t.
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.SelectItem(hChild) = True"

	hChild = var_Items.InsertItem(h,,"Task 2")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	hChild = var_Items.InsertItem(h,,"Task 3")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

oTree.EndUpdate()

627:
How can I change the caption of the checked items (sample 1)

Dim h as N
Dim hChild as N
Dim oTree as P
Dim var_Column as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.LinesAtRoot = -1
var_Column = oTree.Columns.Add("Tasks")
	' var_Column.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(0) = True"

	var_Column.PartialCheck = .t.
	' var_Column.Def(17) = 1
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(17) = 1"

	var_Column.FormatColumn = "value + (%CS0 = 1 ? `<r><fgcolor=808080>(checked)` : ``)"
oTree.HeaderVisible = .t.
var_Items = oTree.Items
	h = var_Items.AddItem("Project")
	hChild = var_Items.InsertItem(h,,"Task 1")
	' var_Items.SelectItem(hChild) = .t.
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.SelectItem(hChild) = True"

	hChild = var_Items.InsertItem(h,,"Task 2")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	hChild = var_Items.InsertItem(h,,"Task 3")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

oTree.EndUpdate()

626:
How can I change the font for the checked items

' Fired after cell's state has been changed.
function CellStateChanged as v (Item  as  OLE::Exontrol.Tree.1::HITEM,ColIndex  as  N)
	oTree = topparent:CONTROL_ACTIVEX1.activex
	oTree.Refresh()
end function

Dim f as P
Dim h as N
Dim hChild as N
Dim oTree as P
Dim var_Column as P
Dim var_ConditionalFormat as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.LinesAtRoot = -1
oTree.DefaultItemHeight = 22
var_Column = oTree.Columns.Add("Tasks")
	' var_Column.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(0) = True"

	var_Column.PartialCheck = .t.
var_ConditionalFormat = oTree.ConditionalFormats.Add("%CS0 = 1")
	f = OLE.Create("StdFont")
		f.Name = oTree.Font.Name
		f.Size = 12
	var_ConditionalFormat.Font = f
oTree.HeaderVisible = .t.
var_Items = oTree.Items
	h = var_Items.AddItem("Project")
	hChild = var_Items.InsertItem(h,,"Task 1")
	' var_Items.SelectItem(hChild) = .t.
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.SelectItem(hChild) = True"

	hChild = var_Items.InsertItem(h,,"Task 2")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	hChild = var_Items.InsertItem(h,,"Task 3")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

oTree.EndUpdate()

625:
How can I bold the checked items

' Fired after cell's state has been changed.
function CellStateChanged as v (Item  as  OLE::Exontrol.Tree.1::HITEM,ColIndex  as  N)
	oTree = topparent:CONTROL_ACTIVEX1.activex
	oTree.Refresh()
end function

Dim h as N
Dim hChild as N
Dim oTree as P
Dim var_Column as P
Dim var_ConditionalFormat as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.LinesAtRoot = -1
var_Column = oTree.Columns.Add("Tasks")
	' var_Column.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(0) = True"

	var_Column.PartialCheck = .t.
var_ConditionalFormat = oTree.ConditionalFormats.Add("%CS0 = 1")
	var_ConditionalFormat.Bold = .t.
oTree.HeaderVisible = .t.
var_Items = oTree.Items
	h = var_Items.AddItem("Project")
	hChild = var_Items.InsertItem(h,,"Task 1")
	' var_Items.SelectItem(hChild) = .t.
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.SelectItem(hChild) = True"

	hChild = var_Items.InsertItem(h,,"Task 2")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	hChild = var_Items.InsertItem(h,,"Task 3")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

oTree.EndUpdate()

624:
How can I change the foreground color for checked items

' Fired after cell's state has been changed.
function CellStateChanged as v (Item  as  OLE::Exontrol.Tree.1::HITEM,ColIndex  as  N)
	oTree = topparent:CONTROL_ACTIVEX1.activex
	oTree.Refresh()
end function

Dim h as N
Dim hChild as N
Dim oTree as P
Dim var_Column as P
Dim var_ConditionalFormat as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.LinesAtRoot = -1
oTree.SelBackMode = 1
var_Column = oTree.Columns.Add("Tasks")
	' var_Column.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(0) = True"

	var_Column.PartialCheck = .t.
var_ConditionalFormat = oTree.ConditionalFormats.Add("%CS0 = 1")
	var_ConditionalFormat.ForeColor = 8421631
oTree.HeaderVisible = .t.
var_Items = oTree.Items
	h = var_Items.AddItem("Project")
	hChild = var_Items.InsertItem(h,,"Task 1")
	' var_Items.SelectItem(hChild) = .t.
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.SelectItem(hChild) = True"

	hChild = var_Items.InsertItem(h,,"Task 2")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	hChild = var_Items.InsertItem(h,,"Task 3")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

oTree.EndUpdate()

623:
How can I change the background color for checked items (solid color)

' Fired after cell's state has been changed.
function CellStateChanged as v (Item  as  OLE::Exontrol.Tree.1::HITEM,ColIndex  as  N)
	oTree = topparent:CONTROL_ACTIVEX1.activex
	oTree.Refresh()
end function

Dim h as N
Dim hChild as N
Dim oTree as P
Dim var_Column as P
Dim var_ConditionalFormat as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.LinesAtRoot = -1
oTree.SelBackMode = 1
var_Column = oTree.Columns.Add("Tasks")
	' var_Column.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(0) = True"

	var_Column.PartialCheck = .t.
var_ConditionalFormat = oTree.ConditionalFormats.Add("%CS0 = 1")
	var_ConditionalFormat.BackColor = 8421631
oTree.HeaderVisible = .t.
var_Items = oTree.Items
	h = var_Items.AddItem("Project")
	hChild = var_Items.InsertItem(h,,"Task 1")
	' var_Items.SelectItem(hChild) = .t.
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.SelectItem(hChild) = True"

	hChild = var_Items.InsertItem(h,,"Task 2")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	hChild = var_Items.InsertItem(h,,"Task 3")
	' var_Items.CellState(hChild) = 1
	oTree.TemplateDef = "dim var_Items,hChild"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = hChild
	oTree.Template = "var_Items.CellState(hChild) = 1"

	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

oTree.EndUpdate()

622:
How can I export the cell's state as well

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as local
Dim var_Column2 as local
Dim var_Column3 as P
Dim var_Columns as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Columns = oTree.Columns
	' var_Columns.Add("C1").Def(0) = .t.
	var_Column = var_Columns.Add("C1")
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(0) = True"

	' var_Columns.Add("C2").FormatColumn = "1 index `A-Z`"
	var_Column1 = var_Columns.Add("C2")
	oTree.TemplateDef = "dim var_Column1"
	oTree.TemplateDef = var_Column1
	oTree.Template = "var_Column1.FormatColumn = `1 index ``A-Z```"

	' var_Columns.Add("C3").FormatColumn = "100 index ``"
	var_Column2 = var_Columns.Add("C3")
	oTree.TemplateDef = "dim var_Column2"
	oTree.TemplateDef = var_Column2
	oTree.Template = "var_Column2.FormatColumn = `100 index `````"

var_Items = oTree.Items
	var_Items.AddItem("Item 1")
	' var_Items.CellState(var_Items.AddItem("Item 2")) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 2`)) = 1"

	' var_Items.CellState(var_Items.AddItem("Item 3")) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 3`)) = 1"

oTree.EndUpdate()
? "Export CSV Items including Check-State:" 
oTree.BeginUpdate()
var_Column3 = oTree.Columns.Add("Check")
	var_Column3.Position = 0
	var_Column3.FormatColumn = "%CS0"
? oTree.Export("") 
oTree.Columns.Remove("Check")
oTree.EndUpdate()

621:
The BeforeExpandItem event is fired when clicking the drop down filter button. What we can do to prevent that (method 2)
' Fired before an item is about to be expanded (collapsed).
function BeforeExpandItem as v (Item  as  OLE::Exontrol.Tree.1::HITEM,Cancel  as  A)
	oTree = topparent:CONTROL_ACTIVEX1.activex
	? "BeforeExpandItem" 
	? Item 
	? "ColumnFromPoint" 
	? oTree.ColumnFromPoint(-1,-1) 
	? "ColumnFromPoint return -1, if the user clicks the +/- glitch, else it returns the index of the column where the click occurs." 
	oTree.Items.InsertItem(Item,,"new child")
end function

Dim oTree as P
Dim var_Column as local
Dim var_Columns as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.LinesAtRoot = -1
var_Columns = oTree.Columns
	' var_Columns.Add("Items").DisplayFilterButton = .t.
	var_Column = var_Columns.Add("Items")
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.DisplayFilterButton = True"

var_Items = oTree.Items
	' var_Items.ItemHasChildren(var_Items.InsertItem(,,"Group 1")) = .t.
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.ItemHasChildren(InsertItem(,,`Group 1`)) = True"

	' var_Items.ItemHasChildren(var_Items.InsertItem(,,"Group 2")) = .t.
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.ItemHasChildren(InsertItem(,,`Group 2`)) = True"

oTree.EndUpdate()

620:
The BeforeExpandItem event is fired when clicking the drop down filter button. What we can do to prevent that (method 1)
' Fired before an item is about to be expanded (collapsed).
function BeforeExpandItem as v (Item  as  OLE::Exontrol.Tree.1::HITEM,Cancel  as  A)
	oTree = topparent:CONTROL_ACTIVEX1.activex
	? "BeforeExpandItem" 
	? Item 
	oTree.Items.InsertItem(Item,,"new child")
end function

Dim oTree as P
Dim var_Column as P
Dim var_Columns as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.LinesAtRoot = -1
var_Columns = oTree.Columns
	var_Column = var_Columns.Add("Items")
		var_Column.DisplayFilterButton = .t.
		var_Column.FilterList = 4
var_Items = oTree.Items
	' var_Items.ItemHasChildren(var_Items.InsertItem(,,"Group 1")) = .t.
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.ItemHasChildren(InsertItem(,,`Group 1`)) = True"

	' var_Items.ItemHasChildren(var_Items.InsertItem(,,"Group 2")) = .t.
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.ItemHasChildren(InsertItem(,,`Group 2`)) = True"

oTree.EndUpdate()

619:
How do I change the drop down filter icon/button (black)

Dim oTree as P
Dim var_Appearance as P
Dim var_Column as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Appearance = oTree.VisualAppearance
	var_Appearance.Add(1,"gBFLBCJwBAEHhEJAAEhABXUIQAAYAQGKIcBiAKBQAGYBIJDEMgzDDAUBjKKocQTC4AIQjCK4JDKHYJRpHEZyCA8EhqGASRAFUQBYiWE4oSpLABQaK0ZwIGyRIrkGQgQgmPYDSDNU4zVIEEglBI0TDNczhNDENgtGYaJqHIYpZBcM40TKkEZoSIITZcRrOEBiRL1S0RBhGcRUHZlWzdN64LhuK47UrWdD/XhdVzXRbjfz1Oq+bxve48Br7A5yYThdr4LhOFQ3RjIL4xbIcUwGe6VZhjOLZXjmO49T69HTtOCYBEBA")
oTree.Template = "Background(0) = 16777216" // oTree.Background(0) = 16777216
oTree.Template = "Background(32) = -1" // oTree.Background(32) = -1
oTree.HeaderAppearance = 0
oTree.BackColorHeader = 0
oTree.ForeColorHeader = 16777215
oTree.HeaderVisible = .t.
oTree.BackColorLevelHeader = oTree.BackColor
var_Column = oTree.Columns.Add("Filter")
	var_Column.DisplayFilterButton = .t.
	var_Column.AllowSort = .f.
	var_Column.AllowDragging = .f.
oTree.EndUpdate()

618:
How do I change the drop down filter icon/button (white)

Dim oTree as P
Dim var_Appearance as P
Dim var_Column as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Appearance = oTree.VisualAppearance
	var_Appearance.Add(2,"gBFLBCJwBAEHhEJAAEhABX8GACAADACAxSDEMQBQKAAzQFAYbhgHCGAAGQaBUgmFgAQhFcZQSKUOQTDKNYykCIRSDUJYkSZEIyjBI8ExXFqNACkGKwYgmNYiTLAcgANJ0WBaGIZJ4gOT5fDKMoEDRRYADFCscwxJybQAqGQKKb+VgAVY/cTyBIAEQSKA0TDOQ5TSKWB4JPZQRBEbZMNBtBIUJquKaqShdQJCU5FdY3Xblez9P7AMBwLFEC4NQ8YNYuPhjR4dRTIMhvVAsUArFh8Zg9GZZFjmDIDT4ydBLTQwcyVIKnP5qOa6XbmPoCQDYKxZHYxPzVDa3axuL76dqCAT7XrXNy1TbNRrzQKfcJqfCbdw2YaDZLOOT3fjuI4hhKaRzFAHJ+jYQ4xHuY4gHuGIXGeExqC8Tp6C+PoEm+G5ImycRgh0XwvDGa5rgOeoejyXwnFeQp2mkf5ClgBB9gCWIYAwfYAEKV58mkdwOggNArgOXY2EWLoDkKOA0mgbhOGgZApgaSBIHWSYHSmbApgYThmESZYJkIeIkgeCpfliLIHgpMIcmUYYYmODAlg2SI4mWfRfGOEguDcCRjFYAJihCQhJBSDoRmONgKEcI4kFCEJhhOVYTmYnAlEAQhWBMJYJGYWoWmWSR2F6F5lnkWAQhUAgpEieRWEuSYkjWGpmkmNhuhuZwJkYcocmaaYkjyEhngnUA6lEFAlAEgI=")
	var_Appearance.Add(1,"CP:2 -14 -4 -2 4")
oTree.Template = "Background(0) = 16777216" // oTree.Background(0) = 16777216
oTree.Template = "Background(32) = BackColor" // oTree.Background(32) = oTree.BackColor
oTree.HeaderAppearance = 0
oTree.BackColorHeader = 16777215
oTree.HeaderVisible = .t.
oTree.HeaderHeight = 24
oTree.BackColorLevelHeader = oTree.BackColor
var_Column = oTree.Columns.Add("Filter")
	var_Column.DisplayFilterButton = .t.
	var_Column.AllowSort = .f.
	var_Column.AllowDragging = .f.
oTree.EndUpdate()

617:
Do you have any Fit-To-Page options when printing the control (W x T, Fit-To )

Dim oTree as P
Dim rs as P
Dim var_Print as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.ColumnAutoResize = .f.
oTree.ContinueColumnScroll = .f.
rs = OLE.Create("ADOR.Recordset")
	rs.Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExTree\Sample\Access2007\sample.accdb",3,3)
oTree.DataSource = rs
oTree.EndUpdate()
var_Print = OLE.Create("Exontrol.Print")
	var_Print.Options = "FitToPage =2 x 1"
	var_Print.PrintExt = oTree
	var_Print.Preview()

616:
Do you have any Fit-To-Page options when printing the control ( x T, Fit-To Tall )

Dim oTree as P
Dim rs as P
Dim var_Print as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.ColumnAutoResize = .f.
oTree.ContinueColumnScroll = .f.
rs = OLE.Create("ADOR.Recordset")
	rs.Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExTree\Sample\Access2007\sample.accdb",3,3)
oTree.DataSource = rs
oTree.EndUpdate()
var_Print = OLE.Create("Exontrol.Print")
	var_Print.Options = "FitToPage = x 2"
	var_Print.PrintExt = oTree
	var_Print.Preview()

615:
Do you have any Fit-To-Page options when printing the control ( W x, Fit-To Wide )

Dim oTree as P
Dim rs as P
Dim var_Print as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.ColumnAutoResize = .f.
oTree.ContinueColumnScroll = .f.
rs = OLE.Create("ADOR.Recordset")
	rs.Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExTree\Sample\Access2007\sample.accdb",3,3)
oTree.DataSource = rs
oTree.EndUpdate()
var_Print = OLE.Create("Exontrol.Print")
	var_Print.Options = "FitToPage = 2 x"
	var_Print.PrintExt = oTree
	var_Print.Preview()

614:
Do you have any Fit-To-Page options when printing the control ( percent view, Adjust-To )

Dim oTree as P
Dim rs as P
Dim var_Print as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.ColumnAutoResize = .f.
oTree.ContinueColumnScroll = .f.
rs = OLE.Create("ADOR.Recordset")
	rs.Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExTree\Sample\Access2007\sample.accdb",3,3)
oTree.DataSource = rs
oTree.EndUpdate()
var_Print = OLE.Create("Exontrol.Print")
	var_Print.Options = "FitToPage = 50%"
	var_Print.PrintExt = oTree
	var_Print.Preview()

613:
How do I prevent changing the cell's state ( check-box state )
' Fired before cell's state is about to be changed.
function CellStateChanging as v (Item  as  OLE::Exontrol.Tree.1::HITEM,ColIndex  as  N,NewState  as  N)
	Dim var_Items as P
	oTree = topparent:CONTROL_ACTIVEX1.activex
	var_Items = oTree.Items
		NewState = var_Items.CellState(Item,ColIndex)
end function

Dim h as N
Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.LinesAtRoot = -1
var_Column = oTree.Columns.Add("P1")
	' var_Column.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(0) = True"

	var_Column.PartialCheck = .t.
var_Column1 = oTree.Columns.Add("P2")
	' var_Column1.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column1"
	oTree.TemplateDef = var_Column1
	oTree.Template = "var_Column1.Def(0) = True"

	var_Column1.PartialCheck = .t.
var_Items = oTree.Items
	h = var_Items.AddItem("Root")
	var_Items.InsertItem(h,,"Child 1")
	var_Items.InsertItem(h,,"Child 2")
	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

oTree.EndUpdate()

612:
How can I use the CellState with ConditionalFormat/ComputedField/FormatColumn

' Fired after cell's state has been changed.
function CellStateChanged as v (Item  as  OLE::Exontrol.Tree.1::HITEM,ColIndex  as  N)
	oTree = topparent:CONTROL_ACTIVEX1.activex
end function

Dim h as N
Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.LinesAtRoot = 4
oTree.SelBackMode = 1
var_Column = oTree.Columns.Add("Items")
	' var_Column.Def(0) = .t.
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(0) = True"

	var_Column.PartialCheck = .t.
var_Column1 = oTree.Columns.Add("Format")
	var_Column1.FormatColumn = "%CS0"
	var_Column1.Caption = var_Column1.FormatColumn
	' var_Column1.Def(5) = 8421504
	oTree.TemplateDef = "dim var_Column1"
	oTree.TemplateDef = var_Column1
	oTree.Template = "var_Column1.Def(5) = 8421504"

	' var_Column1.Def(8) = var_Column1.Def(5)
	oTree.TemplateDef = "dim var_Column1"
	oTree.TemplateDef = var_Column1
	oTree.Template = "var_Column1.Def(8) = Def(5)"

var_Items = oTree.Items
	h = var_Items.AddItem("Root")
	var_Items.InsertItem(h,,"Item 1")
	' var_Items.CellState(var_Items.InsertItem(h,,"Item 2"),0) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(InsertItem(h,,`Item 2`),0) = 1"

	' var_Items.CellState(var_Items.InsertItem(h,,"Item 3"),0) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(InsertItem(h,,`Item 3`),0) = 1"

	' var_Items.ExpandItem(h) = .t.
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.ExpandItem(h) = True"

oTree.EndUpdate()

611:
How can I use the CellData with ConditionalFormat/ComputedField/FormatColumn

Dim oTree as P
Dim var_Column as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.Columns.Add("Items")
var_Column = oTree.Columns.Add("Format")
	var_Column.FormatColumn = "%CD0"
	var_Column.Caption = var_Column.FormatColumn
	' var_Column.Def(5) = 8421504
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(5) = 8421504"

	' var_Column.Def(8) = var_Column.Def(5)
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(8) = Def(5)"

var_Items = oTree.Items
	' var_Items.CellData(var_Items.AddItem("Item 1"),0) = 1234
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellData(AddItem(`Item 1`),0) = 1234"

	' var_Items.CellData(var_Items.AddItem("Item 2"),0) = "this is just an user data"
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellData(AddItem(`Item 2`),0) = `this is just an user data`"

	' var_Items.CellData(var_Items.AddItem("Item 3"),0) = {01/01/2001}
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellData(AddItem(`Item 3`),0) = #1/1/2001#"

oTree.EndUpdate()

610:
How can I use the CellCaption with ConditionalFormat/ComputedField/FormatColumn

Dim h as N
Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.Columns.Add("Items")
var_Column = oTree.Columns.Add("Format")
	var_Column.FormatColumn = "%0"
	var_Column.Caption = var_Column.FormatColumn
	' var_Column.Def(5) = 8421504
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(5) = 8421504"

	' var_Column.Def(8) = var_Column.Def(5)
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Def(8) = Def(5)"

	var_Column.Width = 96
	var_Column.AllowSizing = .f.
var_Column1 = oTree.Columns.Add("Format")
	var_Column1.FormatColumn = "%C0"
	var_Column1.Caption = var_Column1.FormatColumn
	' var_Column1.Def(5) = 8421504
	oTree.TemplateDef = "dim var_Column1"
	oTree.TemplateDef = var_Column1
	oTree.Template = "var_Column1.Def(5) = 8421504"

	' var_Column1.Def(8) = var_Column1.Def(5)
	oTree.TemplateDef = "dim var_Column1"
	oTree.TemplateDef = var_Column1
	oTree.Template = "var_Column1.Def(8) = Def(5)"

	var_Column1.Width = 96
	var_Column1.AllowSizing = .f.
var_Items = oTree.Items
	var_Items.AddItem(1)
	h = var_Items.AddItem(0)
	' var_Items.CellCaption(h,0) = "<b>HTML</b> Text"
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,0) = `<b>HTML</b> Text`"

	' var_Items.CellCaptionFormat(h,0) = 1
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaptionFormat(h,0) = 1"

	var_Items.AddItem(2)
oTree.EndUpdate()

609:
Can I display the radio-button with a solid color

Dim oTree as P
Dim var_Column as local
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.Template = "RadioImage(0) = 32699122" // oTree.RadioImage(.f.) = 32699122
oTree.Template = "RadioImage(1) = 16777216" // oTree.RadioImage(.t.) = 16777216
' oTree.Columns.Add("Check").Def(1) = .t.
var_Column = oTree.Columns.Add("Check")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.Def(1) = True"

var_Items = oTree.Items
	var_Items.AddItem("Radio 1")
	' var_Items.CellState(var_Items.AddItem("Radio 2"),0) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Radio 2`),0) = 1"

	var_Items.AddItem("Radio 1")
oTree.EndUpdate()

608:
Can I display the check-box with a solid color

Dim oTree as P
Dim var_Column as local
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.Template = "CheckImage(0) = 32699122" // oTree.CheckImage(0) = 32699122
oTree.Template = "CheckImage(1) = 16777216" // oTree.CheckImage(1) = 16777216
' oTree.Columns.Add("Check").Def(0) = .t.
var_Column = oTree.Columns.Add("Check")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.Def(0) = True"

var_Items = oTree.Items
	var_Items.AddItem("Check 1")
	' var_Items.CellState(var_Items.AddItem("Check 2"),0) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Check 2`),0) = 1"

	var_Items.AddItem("Check 3")
oTree.EndUpdate()

607:
Can I display the column's multiple-lines caption vertically oriented (method 2)

Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Columns as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.HeaderHeight = 48
oTree.ColumnAutoResize = .t.
var_Columns = oTree.Columns
	var_Columns.Add("And others ...")
	var_Column = var_Columns.Add("")
		var_Column.HTMLCaption = "First Column"
		var_Column.HeaderVertical = .t.
		var_Column.Width = 36
		var_Column.AllowSizing = .f.
		' var_Column.Def(0) = .t.
		oTree.TemplateDef = "dim var_Column"
		oTree.TemplateDef = var_Column
		oTree.Template = "var_Column.Def(0) = True"

		' var_Column.Def(48) = 8
		oTree.TemplateDef = "dim var_Column"
		oTree.TemplateDef = var_Column
		oTree.Template = "var_Column.Def(48) = 8"

		var_Column.Position = 0
	var_Column1 = var_Columns.Add("")
		var_Column1.HTMLCaption = "<c><b>Second Column"
		var_Column1.HeaderVertical = .t.
		var_Column1.Width = 36
		var_Column1.AllowSizing = .f.
		' var_Column1.Def(0) = .t.
		oTree.TemplateDef = "dim var_Column1"
		oTree.TemplateDef = var_Column1
		oTree.Template = "var_Column1.Def(0) = True"

		' var_Column1.Def(48) = 8
		oTree.TemplateDef = "dim var_Column1"
		oTree.TemplateDef = var_Column1
		oTree.Template = "var_Column1.Def(48) = 8"

		var_Column1.Position = 1
	var_Column2 = var_Columns.Add("")
		var_Column2.HTMLCaption = "<r>Third Column"
		var_Column2.HeaderVertical = .t.
		var_Column2.Width = 36
		var_Column2.AllowSizing = .f.
		' var_Column2.Def(0) = .t.
		oTree.TemplateDef = "dim var_Column2"
		oTree.TemplateDef = var_Column2
		oTree.Template = "var_Column2.Def(0) = True"

		' var_Column2.Def(48) = 8
		oTree.TemplateDef = "dim var_Column2"
		oTree.TemplateDef = var_Column2
		oTree.Template = "var_Column2.Def(48) = 8"

		var_Column2.Position = 2
var_Items = oTree.Items
	' var_Items.CellState(var_Items.AddItem("Item 1"),3) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 1`),3) = 1"

	' var_Items.CellState(var_Items.AddItem("Item 2"),2) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 2`),2) = 1"

	' var_Items.CellState(var_Items.AddItem("Item 3"),1) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 3`),1) = 1"

oTree.EndUpdate()

606:
Can I display the column's multiple-lines caption vertically oriented (method 1)

Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Columns as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.HeaderHeight = 48
oTree.HeaderSingleLine = .f.
oTree.ColumnAutoResize = .t.
var_Columns = oTree.Columns
	var_Columns.Add("And others ...")
	var_Column = var_Columns.Add("First Column")
		var_Column.HeaderVertical = .t.
		var_Column.Width = 36
		var_Column.AllowSizing = .f.
		' var_Column.Def(0) = .t.
		oTree.TemplateDef = "dim var_Column"
		oTree.TemplateDef = var_Column
		oTree.Template = "var_Column.Def(0) = True"

		' var_Column.Def(48) = 8
		oTree.TemplateDef = "dim var_Column"
		oTree.TemplateDef = var_Column
		oTree.Template = "var_Column.Def(48) = 8"

		var_Column.Position = 0
	var_Column1 = var_Columns.Add("Second Column")
		var_Column1.HeaderBold = .t.
		var_Column1.HeaderVertical = .t.
		var_Column1.Width = 36
		var_Column1.AllowSizing = .f.
		' var_Column1.Def(0) = .t.
		oTree.TemplateDef = "dim var_Column1"
		oTree.TemplateDef = var_Column1
		oTree.Template = "var_Column1.Def(0) = True"

		' var_Column1.Def(48) = 8
		oTree.TemplateDef = "dim var_Column1"
		oTree.TemplateDef = var_Column1
		oTree.Template = "var_Column1.Def(48) = 8"

		var_Column1.Position = 1
	var_Column2 = var_Columns.Add("Third Column")
		var_Column2.HeaderVertical = .t.
		var_Column2.Width = 36
		var_Column2.AllowSizing = .f.
		' var_Column2.Def(0) = .t.
		oTree.TemplateDef = "dim var_Column2"
		oTree.TemplateDef = var_Column2
		oTree.Template = "var_Column2.Def(0) = True"

		' var_Column2.Def(48) = 8
		oTree.TemplateDef = "dim var_Column2"
		oTree.TemplateDef = var_Column2
		oTree.Template = "var_Column2.Def(48) = 8"

		var_Column2.Position = 2
var_Items = oTree.Items
	' var_Items.CellState(var_Items.AddItem("Item 1"),3) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 1`),3) = 1"

	' var_Items.CellState(var_Items.AddItem("Item 2"),2) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 2`),2) = 1"

	' var_Items.CellState(var_Items.AddItem("Item 3"),1) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 3`),1) = 1"

oTree.EndUpdate()

605:
Can I display the column's caption vertically oriented (method 2)

Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Columns as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.HeaderHeight = 48
oTree.ColumnAutoResize = .t.
var_Columns = oTree.Columns
	var_Columns.Add("And others ...")
	var_Column = var_Columns.Add("")
		var_Column.HTMLCaption = "First"
		var_Column.HeaderVertical = .t.
		var_Column.Width = 20
		var_Column.AllowSizing = .f.
		' var_Column.Def(0) = .t.
		oTree.TemplateDef = "dim var_Column"
		oTree.TemplateDef = var_Column
		oTree.Template = "var_Column.Def(0) = True"

		var_Column.Position = 0
	var_Column1 = var_Columns.Add("")
		var_Column1.HTMLCaption = "<c><b>Second"
		var_Column1.HeaderVertical = .t.
		var_Column1.Width = 20
		var_Column1.AllowSizing = .f.
		' var_Column1.Def(0) = .t.
		oTree.TemplateDef = "dim var_Column1"
		oTree.TemplateDef = var_Column1
		oTree.Template = "var_Column1.Def(0) = True"

		var_Column1.Position = 1
	var_Column2 = var_Columns.Add("")
		var_Column2.HTMLCaption = "<r>Third"
		var_Column2.HeaderVertical = .t.
		var_Column2.Width = 20
		var_Column2.AllowSizing = .f.
		' var_Column2.Def(0) = .t.
		oTree.TemplateDef = "dim var_Column2"
		oTree.TemplateDef = var_Column2
		oTree.Template = "var_Column2.Def(0) = True"

		var_Column2.Position = 2
var_Items = oTree.Items
	' var_Items.CellState(var_Items.AddItem("Item 1"),3) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 1`),3) = 1"

	' var_Items.CellState(var_Items.AddItem("Item 2"),2) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 2`),2) = 1"

	' var_Items.CellState(var_Items.AddItem("Item 3"),1) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 3`),1) = 1"

oTree.EndUpdate()

604:
Can I display the column's caption vertically oriented (method 1)

Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Columns as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.HeaderHeight = 48
oTree.ColumnAutoResize = .t.
var_Columns = oTree.Columns
	var_Columns.Add("And others ...")
	var_Column = var_Columns.Add("First")
		var_Column.HeaderVertical = .t.
		var_Column.Width = 20
		var_Column.AllowSizing = .f.
		' var_Column.Def(0) = .t.
		oTree.TemplateDef = "dim var_Column"
		oTree.TemplateDef = var_Column
		oTree.Template = "var_Column.Def(0) = True"

		var_Column.Position = 0
	var_Column1 = var_Columns.Add("Second")
		var_Column1.HeaderBold = .t.
		var_Column1.HeaderVertical = .t.
		var_Column1.Width = 20
		var_Column1.AllowSizing = .f.
		' var_Column1.Def(0) = .t.
		oTree.TemplateDef = "dim var_Column1"
		oTree.TemplateDef = var_Column1
		oTree.Template = "var_Column1.Def(0) = True"

		var_Column1.Position = 1
	var_Column2 = var_Columns.Add("Third")
		var_Column2.HeaderVertical = .t.
		var_Column2.Width = 20
		var_Column2.AllowSizing = .f.
		' var_Column2.Def(0) = .t.
		oTree.TemplateDef = "dim var_Column2"
		oTree.TemplateDef = var_Column2
		oTree.Template = "var_Column2.Def(0) = True"

		var_Column2.Position = 2
var_Items = oTree.Items
	' var_Items.CellState(var_Items.AddItem("Item 1"),3) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 1`),3) = 1"

	' var_Items.CellState(var_Items.AddItem("Item 2"),2) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 2`),2) = 1"

	' var_Items.CellState(var_Items.AddItem("Item 3"),1) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 3`),1) = 1"

oTree.EndUpdate()

603:
How do I automatically bold items being checked

' Fired after cell's state has been changed.
function CellStateChanged as v (Item  as  OLE::Exontrol.Tree.1::HITEM,ColIndex  as  N)
	oTree = topparent:CONTROL_ACTIVEX1.activex
end function

Dim oTree as P
Dim var_Column as local
Dim var_Column1 as local
Dim var_ConditionalFormat as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.SelBackMode = 1
var_ConditionalFormat = oTree.ConditionalFormats.Add("%CS0","check")
	var_ConditionalFormat.Bold = .t.
' oTree.Columns.Add("Items").Def(0) = .t.
var_Column = oTree.Columns.Add("Items")
oTree.TemplateDef = "dim var_Column"
oTree.TemplateDef = var_Column
oTree.Template = "var_Column.Def(0) = True"

' oTree.Columns.Add(oTree.ConditionalFormats.Item("check").Expression).FormatColumn = oTree.ConditionalFormats.Item("check").Expression
var_Column1 = oTree.Columns.Add(oTree.ConditionalFormats.Item("check").Expression)
oTree.TemplateDef = "dim var_Column1"
oTree.TemplateDef = var_Column1
oTree.Template = "var_Column1.FormatColumn = Me.ConditionalFormats.Item(`check`).Expression"

var_Items = oTree.Items
	var_Items.AddItem("Item 1")
	' var_Items.CellState(var_Items.AddItem("Item 2"),0) = 1
	oTree.TemplateDef = "dim var_Items"
	oTree.TemplateDef = var_Items
	oTree.Template = "var_Items.CellState(AddItem(`Item 2`),0) = 1"

	var_Items.AddItem("Item 3")
oTree.EndUpdate()

602:
How can I include the child items, when a filter is applied

Dim h0 as N
Dim oTree as P
Dim var_Column as local
Dim var_Column1 as local
Dim var_Columns as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
oTree.ColumnAutoResize = .t.
oTree.ContinueColumnScroll = .f.
oTree.MarkSearchColumn = .f.
oTree.SearchColumnIndex = 1
oTree.Indent = 16
oTree.LinesAtRoot = -1
oTree.FilterBarPromptVisible = .t.
oTree.FilterBarPromptPattern = "Nancy"
oTree.FilterInclude = 1
var_Columns = oTree.Columns
	' var_Columns.Add("Name").Width = 96
	var_Column = var_Columns.Add("Name")
	oTree.TemplateDef = "dim var_Column"
	oTree.TemplateDef = var_Column
	oTree.Template = "var_Column.Width = 96"

	' var_Columns.Add("Title").Width = 96
	var_Column1 = var_Columns.Add("Title")
	oTree.TemplateDef = "dim var_Column1"
	oTree.TemplateDef = var_Column1
	oTree.Template = "var_Column1.Width = 96"

	var_Columns.Add("City")
var_Items = oTree.Items
	h0 = var_Items.AddItem("Nancy Davolio")
	' var_Items.CellCaption(h0,1) = "Sales Representative"
	oTree.TemplateDef = "dim var_Items,h0"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h0
	oTree.Template = "var_Items.CellCaption(h0,1) = `Sales Representative`"

	' var_Items.CellCaption(h0,2) = "Seattle"
	oTree.TemplateDef = "dim var_Items,h0"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h0
	oTree.Template = "var_Items.CellCaption(h0,2) = `Seattle`"

	h0 = var_Items.InsertItem(h0,,"Andrew Fuller")
	' var_Items.CellCaption(h0,1) = "Vice President, Sales"
	oTree.TemplateDef = "dim var_Items,h0"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h0
	oTree.Template = "var_Items.CellCaption(h0,1) = `Vice President, Sales`"

	' var_Items.CellCaption(h0,2) = "Tacoma"
	oTree.TemplateDef = "dim var_Items,h0"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h0
	oTree.Template = "var_Items.CellCaption(h0,2) = `Tacoma`"

	h0 = var_Items.InsertItem(h0,,"Michael Suyama")
	' var_Items.CellCaption(h0,1) = "Sales Representative"
	oTree.TemplateDef = "dim var_Items,h0"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h0
	oTree.Template = "var_Items.CellCaption(h0,1) = `Sales Representative`"

	' var_Items.CellCaption(h0,2) = "London"
	oTree.TemplateDef = "dim var_Items,h0"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h0
	oTree.Template = "var_Items.CellCaption(h0,2) = `London`"

	h0 = var_Items.AddItem("Janet Leverling")
	' var_Items.CellCaption(h0,1) = "Sales Representative"
	oTree.TemplateDef = "dim var_Items,h0"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h0
	oTree.Template = "var_Items.CellCaption(h0,1) = `Sales Representative`"

	' var_Items.CellCaption(h0,2) = "Kirkland"
	oTree.TemplateDef = "dim var_Items,h0"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h0
	oTree.Template = "var_Items.CellCaption(h0,2) = `Kirkland`"

	h0 = var_Items.InsertItem(h0,,"Margaret Peacock")
	' var_Items.CellCaption(h0,1) = "Sales Representative"
	oTree.TemplateDef = "dim var_Items,h0"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h0
	oTree.Template = "var_Items.CellCaption(h0,1) = `Sales Representative`"

	' var_Items.CellCaption(h0,2) = "Redmond"
	oTree.TemplateDef = "dim var_Items,h0"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h0
	oTree.Template = "var_Items.CellCaption(h0,2) = `Redmond`"

oTree.ApplyFilter()
oTree.EndUpdate()

601:
How do I get sorted the column as string, numeric, date, date and time. Also how can it be applied to drop down filter panel

Dim h as N
Dim oTree as P
Dim var_Column as P
Dim var_Column1 as P
Dim var_Column2 as P
Dim var_Column3 as P
Dim var_Column4 as P
Dim var_Items as P

oTree = topparent:CONTROL_ACTIVEX1.activex
oTree.BeginUpdate()
var_Column = oTree.Columns.Add("Date")
	var_Column.SortType = 2
	var_Column.DisplayFilterButton = .t.
	var_Column.DisplayFilterPattern = .f.
	var_Column.DisplayFilterDate = .t.
	var_Column.FilterList = 1296 'exShowFocusItem + exShowCheckBox + exSortItemsDesc
var_Column1 = oTree.Columns.Add("DateTime")
	var_Column1.SortType = 3
	var_Column1.DisplayFilterButton = .t.
	var_Column1.DisplayFilterPattern = .f.
	var_Column1.FilterList = 1296 'exShowFocusItem + exShowCheckBox + exSortItemsDesc
var_Column2 = oTree.Columns.Add("Time")
	var_Column2.SortType = 4
	var_Column2.DisplayFilterButton = .t.
	var_Column2.DisplayFilterPattern = .f.
	var_Column2.FilterList = 1296 'exShowFocusItem + exShowCheckBox + exSortItemsDesc
	var_Column2.FormatColumn = "time(value)"
var_Column3 = oTree.Columns.Add("Numeric")
	var_Column3.SortType = 1
	var_Column3.DisplayFilterButton = .t.
	var_Column3.FilterList = 1296 'exShowFocusItem + exShowCheckBox + exSortItemsDesc
var_Column4 = oTree.Columns.Add("String")
	var_Column4.DisplayFilterButton = .t.
	var_Column4.FilterList = 1296 'exShowFocusItem + exShowCheckBox + exSortItemsDesc
var_Items = oTree.Items
	h = var_Items.AddItem({01/27/2010})
	' var_Items.CellCaption(h,1) = {01/27/2010 10:00:00}
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,1) = #1/27/2010 10:00:00 AM#"

	' var_Items.CellCaption(h,2) = var_Items.CellCaption(h,1)
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,2) = CellCaption(h,1)"

	' var_Items.CellCaption(h,3) = 1
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,3) = 1"

	' var_Items.CellCaption(h,4) = var_Items.CellCaption(h,3)
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,4) = CellCaption(h,3)"

	h = var_Items.AddItem({01/27/2011})
	' var_Items.CellCaption(h,1) = {01/27/2011 09:00:00}
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,1) = #1/27/2011 9:00:00 AM#"

	' var_Items.CellCaption(h,2) = var_Items.CellCaption(h,1)
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,2) = CellCaption(h,1)"

	' var_Items.CellCaption(h,3) = 11
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,3) = 11"

	' var_Items.CellCaption(h,4) = var_Items.CellCaption(h,3)
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,4) = CellCaption(h,3)"

	h = var_Items.AddItem({11/02/2010})
	' var_Items.CellCaption(h,1) = {11/02/2010 09:00:00}
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,1) = #11/2/2010 9:00:00 AM#"

	' var_Items.CellCaption(h,2) = var_Items.CellCaption(h,1)
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,2) = CellCaption(h,1)"

	' var_Items.CellCaption(h,3) = 2
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,3) = 2"

	' var_Items.CellCaption(h,4) = var_Items.CellCaption(h,3)
	oTree.TemplateDef = "dim var_Items,h"
	oTree.TemplateDef = var_Items
	oTree.TemplateDef = h
	oTree.Template = "var_Items.CellCaption(h,4) = CellCaption(h,3)"

oTree.Columns.Item("DateTime").DisplayFilterDate = .f.
oTree.EndUpdate()