79
ImageSize property on 32 (specifies the size of control' icons/images/check-boxes/radio-buttons)

PROCEDURE OnCreateView(oCascadeTree,View)
	/*Items.ItemHeight(0) = View.DefaultItemHeight*/
	/*FilterBarFont.Size = Me.Font.Size*/
	/*ToolTipFont.Size = Me.Font.Size*/
	LOCAL oView
	LOCAL oObject
	oView := oCascadeTree:View()
		oView:DefaultItemHeight := 36
		oView:HeaderHeight := oView:DefaultItemHeight()
		oView:SortBarHeight := oView:DefaultItemHeight()
		oView:Indent := 26
		oView:SetProperty("CheckImage",0/*Unchecked*/,16777216)
		oView:SetProperty("CheckImage",1/*Checked*/,33554432)
		oView:SetProperty("CheckImage",2/*PartialChecked*/,50331648)
		oView:EnsureVisibleColumn("Function")
		oObject := oView:Columns:Item("Function")
		oView:Columns:Item(0):SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oAppearance

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:ImageSize := 32
		oCascadeTree:Font():Size := 16
		oCascadeTree:Images("gBJJgBAIDAAEg4AEEKAD/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E4FA6hWY4tjEAAQBAgIA==")
		oCascadeTree:SetProperty("BackColorHeader",0x4c6c6c6)
		oCascadeTree:SetProperty("SelBackColor",0x4000000)
		oCascadeTree:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,1 } )  , .F. ))
		oCascadeTree:SetProperty("Background",20/*0x14+*/,oCascadeTree:SelBackColor())
		oCascadeTree:SetProperty("Background",21/*0x15+*/,oCascadeTree:SelForeColor())
		oCascadeTree:SetProperty("Background",26/*0x8+exSplitBar*/,oCascadeTree:BackColor())
		oCascadeTree:SetProperty("Background",27/*0x9+exSplitBar*/,oCascadeTree:ForeColor())
		oCascadeTree:SetProperty("Background",32/*0x20+*/,-1)
		oCascadeTree:SetProperty("Background",0/*0x0+*/,0x4000000)
		oCascadeTree:SetProperty("Background",41/*exHeaderFilterBarActive*/,0x4010101)
		oCascadeTree:SetProperty("Background",1/*0x1+*/,0x40000ff)
		oCascadeTree:HeaderAppearance := 4/*Etched*/
		oCascadeTree:SetProperty("BackColorSortBar",oCascadeTree:BackColor())
		oCascadeTree:SetProperty("BackColorLevelHeader",oCascadeTree:BackColor())
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\MN"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
78
ImageSize property on 16 (default) (specifies the size of control' icons/images/check-boxes/radio-buttons)

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oView
	LOCAL oObject
	oView := oCascadeTree:View()
		oView:EnsureVisibleColumn("Function")
		oObject := oView:Columns:Item("Function")
		oView:Columns:Item(0):SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oAppearance

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:ImageSize := 16
		oCascadeTree:Images("gBJJgBAIDAAEg4ACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjMLjABAAgjUYkUnlUrlktl0vmExmUzmk1m03nE5nU7nkrQCAntBoVDolFo1HoM/ADAplLptImdMYFOqdSqlXq1QrVbrlGpVWsFNrNdnNjsk7pQAtNroFnt0sh8Yr9iulTuNxs1Eu8OiT/vsnsNVutXlk/oGGtVKxGLxWNtsZtN8iUYuNvy0Zvd+xNYwdwvl4p870GCqc8vOeuVttmp1knyOayWVy+WzN/ze1wOElenm+12WUz/Bv2/3U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AoLoLmMCJGDKDJjJiLA7xqUAAgGTwYnYPoPmQCQGEKEJkEkFg9gGY44BoRoSmSSQ2EKEggHgRhShSZRJFYVoVmWCRmFKFAgGOTheheZgJgYYoYmYSYWGaF4lkMMJ0hqZpJjYbobmcCZGHKHJmjmJh0h2Z4JmYcIaE8WZ2H6H5oAoBoCiCaBKBYfdjGoJoKiKaJKDaDojmkChGgmIgpCoVoWiWaJZiSd4mmmSh2h6J5qAqBoiiiaY5iSeIpmqComiqKpqkqNouiuah6hqMIsmsSpWiuGhP1kOoumuSp2j6L5sAsBo54gKwWkaMZsgsJpKjKbJLDaRYxYWRpSjSbIZiSe41m2CxmlqNptksdpejebR5iSfI4m4S4W16boLiaao6m5fJ9jubwLkaco8m8S5WnaPZunuOp4j6b5Lnac4SA0PAGlgP4wEwFwGkGcIMCcCpCnCCxiA8NYAAmMJfkSbh" +;
		"FCcFpFnGDBnBqRpUhuEwTDeZ5lHCfw6HIQxLCaAxygyJwqgGcATE4FA6hWY4tjEAAQBAgIA==")
		oCascadeTree:SetProperty("BackColorHeader",0x4c6c6c6)
		oCascadeTree:SetProperty("SelBackColor",0x4000000)
		oCascadeTree:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,1 } )  , .F. ))
		oCascadeTree:SetProperty("Background",20/*0x14+*/,oCascadeTree:SelBackColor())
		oCascadeTree:SetProperty("Background",21/*0x15+*/,oCascadeTree:SelForeColor())
		oCascadeTree:SetProperty("Background",26/*0x8+exSplitBar*/,oCascadeTree:BackColor())
		oCascadeTree:SetProperty("Background",27/*0x9+exSplitBar*/,oCascadeTree:ForeColor())
		oCascadeTree:SetProperty("Background",32/*0x20+*/,-1)
		oCascadeTree:SetProperty("Background",0/*0x0+*/,0x4000000)
		oCascadeTree:SetProperty("Background",41/*exHeaderFilterBarActive*/,0x4010101)
		oCascadeTree:SetProperty("Background",1/*0x1+*/,0x40000ff)
		oCascadeTree:HeaderAppearance := 4/*Etched*/
		oCascadeTree:SetProperty("BackColorSortBar",oCascadeTree:BackColor())
		oCascadeTree:SetProperty("BackColorLevelHeader",oCascadeTree:BackColor())
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\MN"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
77
Is it possible to highlight the column's header once a filter is applied

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oAppearance
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oItems
	LOCAL oView
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:BeginUpdate()
		oAppearance := oCascadeTree:VisualAppearance()
			oAppearance:Add(2,"gBFLBCJwBAEHhEJAAEhABX8GACAADACAxSDEMQBQKAAzQFAYbhgHCGAAGQaBUgmFgAQhFcZQSKUOQTDKNYykCIRSDUJYkSZEIyjBI8ExXFqNACkGKwYgmNYiTLAcgANJ0WBaGIZJ4gOT5fDKMoEDRRYADFCscwxJybQAqGQKKb+VgAVY/cTyBIAEQSKA0TDOQ5TSKWB4JPZQRBEbZMNBtBIUJquKaqShdQJCU5FdY3Xblez9P7AMBwLFEC4NQ8YNYuPhjR4dRTIMhvVAsUArFh8Zg9GZZFjmDIDT4ydBLTQwcyVIKnP5qOa6XbmPoCQDYKxZHYxPzVDa3axuL76dqCAT7XrXNy1TbNRrzQKfcJqfCbdw2YaDZLOOT3fjuI4hhKaRzFAHJ+jYQ4xHuY4gHuGIXGeExqC8Tp6C+PoEm+G5ImycRgh0XwvDGa5rgOeoejyXwnFeQp2mkf5ClgBB9gCWIYAwfYAEKV58mkdwOggNArgOXY2EWLoDkKOA0mg" +;
		"bhOGgZApgaSBIHWSYHSmbApgYThmESZYJkIeIkgeCpfliLIHgpMIcmUYYYmODAlg2SI4mWfRfGOEguDcCRjFYAJihCQhJBSDoRmONgKEcI4kFCEJhhOVYTmYnAlEAQhWBMJYJGYWoWmWSR2F6F5lnkWAQhUAgpEieRWEuSYkjWGpmkmNhuhuZwJkYcocmaaYkjyEhngnUA6lEFAlAEgI=")
			oAppearance:Add(1,"CP:2 -8 -4 2 4")
		oCascadeTree:SetProperty("Background",0/*0x0+*/,0x1fefefe)
		oCascadeTree:SetProperty("Background",41/*exHeaderFilterBarActive*/,0x1010101)
		oCascadeTree:SetProperty("Background",32/*0x20+*/,-1)
		oCascadeTree:SetProperty("BackColorHeader",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
		oCascadeTree:Mode := 1/*exSingleCascadeMode*/
		oView := oCascadeTree:DefaultView()
			oView:HeaderHeight := 28
			oView:DrawGridLines := -2/*exRowLines*/
			oView:HeaderVisible := .T.
			oColumns := oView:Columns()
				oColumns:Add("C1"):DisplayFilterButton := .T.
				oColumn := oColumns:Add("C2")
					oColumn:DisplayFilterButton := .T.
					oColumn:Filter := "Item 2"
					oColumn:FilterType := 240/*exFilter*/
				oColumns:Add("C3"):DisplayFilterButton := .T.
			oItems := oView:Items()
				h := oItems:AddItem("Item 1")
				oItems:SetProperty("CellValue",h,1,"Item 2")
				oItems:SetProperty("CellValue",h,2,"Item 3")
				h := oItems:AddItem("Item 4")
				oItems:SetProperty("CellValue",h,1,"Item 5")
				oItems:SetProperty("CellValue",h,2,"Item 6")
			oView:ApplyFilter()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
76
Is it possible to show the filterbar on top of the rows

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oColumn,oColumn1
	LOCAL oItems
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 1/*exSingleCascadeMode*/
		oView := oCascadeTree:DefaultView()
			oView:ColumnAutoResize := .T.
			oView:FilterBarPromptVisible := 8192/*exFilterBarTop*/
			oView:HeaderHeight := 24
			oView:FilterBarHeight := oView:HeaderHeight()
			oView:HeaderAppearance := 1/*Flat*/
			oView:DrawGridLines := -1/*exAllLines*/
			oView:GridLineStyle := 512/*exGridLinesGeometric*/
			oColumn := oView:Columns():Add("Column")
				oColumn:DisplayFilterButton := .T.
				oColumn:FilterType := 3/*exPattern*/
				oColumn:Filter := "B*"
			oColumn1 := oView:Columns():Add("Index")
				oColumn1:FormatColumn := "1 index ``"
				oColumn1:Position := 0
				oColumn1:Width := 48
				oColumn1:AllowSizing := .F.
				oColumn1:SortType := 1/*SortNumeric*/
				oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
			oItems := oView:Items()
				oItems:AddItem("A.1")
				oItems:AddItem("A.2")
				oItems:AddItem("B.1")
				oItems:AddItem("B.2")
				oItems:AddItem("B.3")
				oItems:AddItem("C")
			oView:ApplyFilter()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
75
Is there anyway to stop the header changing colour when the mouse hovers/moves across the column header (non-clickable)

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oItems
	LOCAL oView
	LOCAL k
	oView := oCascadeTree:View()
		k := oView:ParentView:Value()
		oView:BeginUpdate()
		oView:ColumnAutoResize := .T.
		oView:Columns():Add(Transform(k,""))
		oItems := oView:Items()
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 1`",k))
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 2`",k))
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 3`",k))
		oView:EndUpdate()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oColumn
	LOCAL oItems
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/

		oCascadeTree:BeginUpdate()
		oView := oCascadeTree:View()
			oView:BeginUpdate()
			oView:ColumnAutoResize := .T.
			oColumn := oView:Columns():Add("Default")
				oColumn:AllowSort := .F.
				oColumn:AllowDragging := .F.
			oView:Key := 0
			oItems := oView:Items()
				oItems:AddItem("Item A")
				oItems:SetProperty("SelectItem",oItems:AddItem("Item B"),.T.)
				oItems:AddItem("Item C")
			oView:EndUpdate()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
74
Is there anyway to stop the header changing colour when the mouse hovers/moves across the column header

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oItems
	LOCAL oView
	LOCAL k
	oView := oCascadeTree:View()
		k := oView:ParentView:Value()
		oView:BeginUpdate()
		oView:ColumnAutoResize := .T.
		oView:Columns():Add(Transform(k,""))
		oItems := oView:Items()
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 1`",k))
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 2`",k))
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 3`",k))
		oView:EndUpdate()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oItems
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:SetProperty("Background",32/*0x20+*/,-1)
		oView := oCascadeTree:View()
			oView:BeginUpdate()
			oView:ColumnAutoResize := .T.
			oView:Columns():Add("Default")
			oView:Key := 0
			oItems := oView:Items()
				oItems:AddItem("Item A")
				oItems:SetProperty("SelectItem",oItems:AddItem("Item B"),.T.)
				oItems:AddItem("Item C")
			oView:EndUpdate()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
73
Type of wraps the cell's caption support (Sample 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oColumn,oColumn1,oColumn2
	LOCAL oColumns
	LOCAL oItems
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Mode := 1/*exSingleCascadeMode*/
		oView := oCascadeTree:DefaultView()
			oView:BeginUpdate()
			oView:HeaderSingleLine := .F.
			oView:HeaderHeight := 36
			oView:DrawGridLines := -2/*exRowLines*/
			oView:ColumnAutoResize := .F.
			oView:ScrollBySingleLine := .T.
			oColumns := oView:Columns()
				oColumn := oColumns:Add("Single-Line (exCaptionSingleLine)")
					oColumn:Width := 96
					oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
					oColumn:SetProperty("Def",16/*exCellSingleLine*/,-1)
				oColumn1 := oColumns:Add("Word-Wrap (exCaptionWordWrap)")
					oColumn1:Width := 96
					oColumn1:SetProperty("Def",17/*exCellValueFormat*/,1)
					oColumn1:SetProperty("Def",16/*exCellSingleLine*/,0)
					oColumn1:FormatColumn := "%0"
				oColumn2 := oColumns:Add("Break-Wrap (exCaptionBreakWrap)")
					oColumn2:Width := 96
					oColumn2:SetProperty("Def",17/*exCellValueFormat*/,1)
					oColumn2:SetProperty("Def",16/*exCellSingleLine*/,1)
					oColumn2:FormatColumn := "%0"
			oItems := oView:Items()
				oItems:AddItem("This is the <b>first</b> line.<br>This is the <b>second</b> line.<br>This is the <b>third</b> line.")
				oItems:AddItem("This is the <b>first</b> line.\r\nThis is the <b>second</b> line.\r\nThis is the <b>third</b> line.")
			oView:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
72
Type of wraps the cell's caption support (Sample 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oItems
	LOCAL oView
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Mode := 1/*exSingleCascadeMode*/
		oView := oCascadeTree:DefaultView()
			oView:BeginUpdate()
			oView:HeaderSingleLine := .F.
			oView:HeaderHeight := 36
			oView:DrawGridLines := -2/*exRowLines*/
			oView:ColumnAutoResize := .F.
			oView:ScrollBySingleLine := .T.
			oView:Columns():Add("Default"):Width := 128
			oItems := oView:Items()
				h := oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line.")
				h := oItems:AddItem("This is the <b>first</b> line.<br>This is the <b>second</b> line.<br>This is the <b>third</b> line.")
				oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/)
				h := oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line.")
				oItems:SetProperty("CellSingleLine",h,0,0/*exCaptionWordWrap*/)
				h := oItems:AddItem("This is the <b>first</b> line.<br>This is the <b>second</b> line.<br>This is the <b>third</b> line.")
				oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/)
				oItems:SetProperty("CellSingleLine",h,0,0/*exCaptionWordWrap*/)
				h := oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line.")
				oItems:SetProperty("CellSingleLine",h,0,1/*exCaptionBreakWrap*/)
				h := oItems:AddItem("This is the <b>first</b> line.<br>This is the <b>second</b> line.<br>This is the <b>third</b> line.")
				oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/)
				oItems:SetProperty("CellSingleLine",h,0,1/*exCaptionBreakWrap*/)
			oView:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
71
Can I break the cell's caption using the line break <br> or \r\n (Sample 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oItems
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Mode := 1/*exSingleCascadeMode*/
		oView := oCascadeTree:DefaultView()
			oView:BeginUpdate()
			oView:DrawGridLines := -2/*exRowLines*/
			oView:ColumnAutoResize := .F.
			oView:ScrollBySingleLine := .T.
			oView:Columns():Add("Default"):Width := 128
			oItems := oView:Items()
				oItems:SetProperty("CellSingleLine",oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line."),0,1/*exCaptionBreakWrap*/)
				oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line.")
			oView:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
70
Can I break the cell's caption using the line break <br> or \r\n (Sample 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oColumn
	LOCAL oItems
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Mode := 1/*exSingleCascadeMode*/
		oView := oCascadeTree:DefaultView()
			oView:BeginUpdate()
			oView:DrawGridLines := -2/*exRowLines*/
			oView:ColumnAutoResize := .F.
			oView:ScrollBySingleLine := .T.
			oColumn := oView:Columns():Add("Default")
				oColumn:Width := 128
				oColumn:SetProperty("Def",16/*exCellSingleLine*/,1)
			oItems := oView:Items()
				oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line.")
				oItems:AddItem("This is the first line.\r\nThis is the second line.\r\nThis is the third line.")
			oView:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
69
Is it possible to change the visual appearance of the position signs when user changes the column's position by drag and drop

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oAppearance
	LOCAL oColumns
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:BeginUpdate()
		oAppearance := oCascadeTree:VisualAppearance()
			oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABZEGACAADACAxRDgMQBQKAAzAJBIYhiG4cYCgMYxXDOCYXABCEYRXBIZQ7BKNIxjSJwFgmEgADKMA4SOKIZhrE4bBhGaQRUgyI43RhHUBzVIUcQvE6TZRHCQYHgkNIhDJIM7TPLkeSVJaTIRoKhJUogApQThTMgVRDEThkGoSa6soSoYTDBKybLrSLKagOT5YUDKUqSdKEZRpEq1YztWbaQoCUoqVRRVIWfbNd4JJa4aDhWpYdpeeY5R7bWLgBYVVABL7LLRsSxpHxPF6RXxaeI3GKsaS8G6ic6nPQMHj7I4NS5pUa6Rh2VYNSa8AAtETRYznOw4bTMXAjNIea5bAYIIR5HIoDzVbQcCQAHL9DBeEMIQEEISgGhMGZQmocgymoYRRCIEQ0G2HYBnEIBig4V4zCQGINnmagCECY43medZ6H2Pw/g+X5fnueh/h+R5+AKABfkMWgGgGYA4AICoCGCE5WA4CphACMgSD2IRIDI" +;
		"BICmEd5YGCBpRjGBgegWIYIgWdgoGIRQsiKCZiAiJZ0gGQI4jUS4LECOAiBmDJflGfg2BSY4Al4OhGkOCJ2DgFJjGGfgqgiH5Ch4RhGkqOQmEOEpkFkHQYhJRYyESAokGKHhIhKIxJEmf4VGUeRGFmF5iBkchPhYJQ5GoYIZg6Ug6GoFYmkmNhuhulRGHKGoImefh0BUZ4JmYeoemeSZ2H6HQmgoBgXDqXwUAQgI=")
			oAppearance:Add(2,"CP:1 0 -36 0 0")
		oCascadeTree:SetProperty("Background",182/*exColumnsPositionSign*/,0x2000000)
		oCascadeTree:Mode := 1/*exSingleCascadeMode*/
		oView := oCascadeTree:DefaultView()
			oView:BeginUpdate()
			oView:HeaderAppearance := 4/*Etched*/
			oColumns := oView:Columns()
				oColumns:Add("Column 1")
				oColumns:Add("Column 2")
				oColumns:Add("Column 3")
			oView:EndUpdate()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
68
DataSource (control, ADODB, ACCDB, x64)

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oView
	LOCAL bColumnAutoResize,bSingle
	bSingle := oCascadeTree:FormatABC("value > 0 ?  0 : -1",oCascadeTree:View:Index())
	bColumnAutoResize := oCascadeTree:FormatABC("value = `City` ?  0 : -1",oCascadeTree:View:Tag())
	oView := oCascadeTree:View()
		oView:ColumnAutoResize := .F.
		oView:SingleSel := .F.
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 515/*exAutoFitOnResizeClient+exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "locktype=1;Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Na" +;
		"me=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
67
DataSource (view, ADODB, ACCDB, x64)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oView
	LOCAL ado

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<b>DataSource</b> could be string (Source/Member), ADO or DAO objects"
		oCascadeTree:DefColumnWidth := 336
		ado := CreateObject("ADODB.Recordset")
			ado:Open("Countries","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb",3/*adOpenStatic*/,1/*adLockReadOnly*/,-1)
		oView := oCascadeTree:DefaultView()
			oView:DataSource := ado
			oView:ColumnAutoResize := .T.
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
66
Simple sample

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oView
	LOCAL bColumnAutoResize,bSingle
	bSingle := oCascadeTree:FormatABC("value > 0 ?  0 : -1",oCascadeTree:View:Index())
	bColumnAutoResize := oCascadeTree:FormatABC("value = `City` ?  0 : -1",oCascadeTree:View:Tag())
	oView := oCascadeTree:View()
		oView:ColumnAutoResize := .F.
		oView:SingleSel := .F.
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 515/*exAutoFitOnResizeClient+exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
65
FilterBar sample

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oColumn,oColumn1,oColumn2,oColumn3,oColumn4,oColumn5
	LOCAL oView,oView1,oView2,oView3,oView4,oView5
	oView := oCascadeTree:View()
		oView:HeaderHeight := 20
		oView:HeaderAppearance := 4/*Etched*/
		oView:DrawGridLines := -1/*exAllLines*/
		oView:GridLineStyle := 12/*exGridLinesDash*/
	oView1 := oCascadeTree:DefaultView()
		oView2 := oView1:View("Country")
			oView2:BeginUpdate()
			oView2:ColumnAutoResize := .T.
			oView2:Columns:Item(0):Visible := .F.
			oColumn := oView2:Columns:Item(1)
				oColumn:HTMLCaption := "Country"
				oColumn:DisplayFilterButton := .T.
				oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
				oColumn:FilterBarDropDownWidth := 2
			oView2:EndUpdate()
		oView3 := oView1:View("State")
			oView3:BeginUpdate()
			oView3:ColumnAutoResize := .T.
			oView3:Columns:Item(0):Visible := .F.
			oView3:Columns:Item(1):Visible := .F.
			oColumn1 := oView3:Columns:Item(2)
				oColumn1:HTMLCaption := "State"
				oColumn1:DisplayFilterButton := .T.
				oColumn1:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
				oColumn1:FilterBarDropDownWidth := 2
			oView3:EndUpdate()
		oView4 := oView1:View("City")
			oView4:BeginUpdate()
			oView4:Columns:Item("CountryCode"):Visible := .F.
			oView4:Columns:Item("StateCode"):Visible := .F.
			oColumn2 := oView4:Columns:Item("Name")
				oColumn2:HTMLCaption := "City"
				oColumn2:Width := 128
				oColumn2:DisplayFilterButton := .T.
				oColumn2:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
				oColumn2:FilterBarDropDownWidth := 2
			oView4:SearchColumnIndex := oView4:Columns:Item("Name"):Index()
			oColumn3 := oView4:Columns:Item("Status")
				oColumn3:DisplayFilterButton := .T.
				oColumn3:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
				oColumn3:FilterBarDropDownWidth := 2
			oColumn4 := oView4:Columns:Item("Function")
				oColumn4:SetProperty("Def",17/*exCellValueFormat*/,1)
				oColumn4:FormatColumn := "value replace 1 with `<img>1</img>` replace 2 with `<img>2</img>` replace 3 with `<img>3</img>` replace 4 with `<img>4</img>` replace 5 with `<img>5</img>` replace 6 with `<img>6</img>` replace 7 with `<img>7</img>` replace 8 with `<img>8</img>` replace 9 with `<img>9</img>` replace `-` with `` "
			oColumn5 := oView4:Columns():Add("Pos")
				oColumn5:AllowSizing := .F.
				oColumn5:Width := 32
				oColumn5:SetProperty("Def",4/*exCellBackColor*/,15790320)
				oColumn5:Position := 0
				oColumn5:FormatColumn := "1 pos ``"
				oColumn5:Alignment := 1/*CenterAlignment*/
				oColumn5:HeaderAlignment := oColumn5:Alignment()
			oView4:CountLockedColumns := 1
			oView4:Width := oView4:WidthToFit()
			oView4:EndUpdate()
	oView5 := oCascadeTree:View()
		oView5:FilterBarHeight := 36
		oView5: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)`) )))"
		oView5:FilterBarPromptVisible := 515/*exFilterBarShowCloseIfRequired+exFilterBarVisible+exFilterBarPromptVisible*/
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oAppearance
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Images("C:\Program Files\Exontrol\ExCascadeTree\Sample\Bullets\Bullet-01.ico")
		oCascadeTree:Images("C:\Program Files\Exontrol\ExCascadeTree\Sample\Bullets\Bullet-02.ico")
		oCascadeTree:Images("C:\Program Files\Exontrol\ExCascadeTree\Sample\Bullets\Bullet-03.ico")
		oCascadeTree:Images("C:\Program Files\Exontrol\ExCascadeTree\Sample\Bullets\Bullet-04.ico")
		oCascadeTree:Images("C:\Program Files\Exontrol\ExCascadeTree\Sample\Bullets\Bullet-05.ico")
		oCascadeTree:Images("C:\Program Files\Exontrol\ExCascadeTree\Sample\Bullets\Bullet-06.ico")
		oCascadeTree:Images("C:\Program Files\Exontrol\ExCascadeTree\Sample\Bullets\Bullet-07.ico")
		oCascadeTree:Images("C:\Program Files\Exontrol\ExCascadeTree\Sample\Bullets\Bullet-08.ico")
		oCascadeTree:Images("C:\Program Files\Exontrol\ExCascadeTree\Sample\Bullets\Bullet-09.ico")
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.mdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "RO\CJ"
		oView := oCascadeTree:DefaultView():View("City")
			oView:FilterBarPromptPattern := "Tu"
		oAppearance := oCascadeTree:VisualAppearance()
			oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABZEGACAADACAxRDgMQBQKAAzAJBIYhiG4cYCgMYxXDOCYXABCEYRXBIZQ7BKNIxjSJwFgmEgADKMA4SOKIZhrE4bBhGaQRUgyI43RhHUBzVIUcQvE6TZRHCQYHgkNIhDJIM7TPLkeSVJaTIRoKhJUogApQThTMgVRDEThkGoSa6soSoYTDBKybLrSLKagOT5YUDKUqSdKEZRpEq1YztWbaQoCUoqVRRVIWfbNd4JJa4aDhWpYdpeeY5R7bWLgBYVVABL7LLRsSxpHxPF6RXxaeI3GKsaS8G6ic6nPQMHj7I4NS5pUa6Rh2VYNSa8AAtETRYznOw4bTMXAjNIea5bAYIIR5HIoDzVbQcCQAHL9DBeEMIQEEISgGhMGZQmocgymoYRRCIEQ0G2HYBnEIBig4V4zCQGINnmagCECY43medZ6H2Pw/g+X5fnueh/h+R5+AKABfkMWgGgGYA4AICoCGCE5WA4CphACMgSD2IRIDI" +;
		"BICmEd5YGCBpRjGBgegWIYIgWdgoGIRQsiKCZiAiJZ0gGQI4jUS4LECOAiBmDJflGfg2BSY4Al4OhGkOCJ2DgFJjGGfgqgiH5Ch4RhGkqOQmEOEpkFkHQYhJRYyESAokGKHhIhKIxJEmf4VGUeRGFmF5iBkchPhYJQ5GoYIZg6Ug6GoFYmkmNhuhulRGHKGoImefh0BUZ4JmYeoemeSZ2H6HQmgoBgXDqXwUAQgI=")
			oAppearance:Add(2,"gBFLBCJwBAEHhEJAAEhABHQDg6AADACAxRDgMQBQKAAzAJBIYhiG4cYCgMZhXDOCYXABCEYR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CJ0DSLRzGSWQ/lmY5+mEP5gmMDBZRSMRsFsOxMhMJJ/DsTpTnwaQaE+N5ojuNhdEYNI5C4TZJO1GRDmCaxnA2Yx4n8IpIjOTBQBQC5TgyYw7gUYRYikC0BYRwsDQBoB8eA6Q2hsE0BUXgywZtYCyHMKwnxSAhAQHkIQhRrBaDsCwA4ERiB2EWAIYIXhhiVEgAEUYwwYjyASLge4FhHgRDkM8OQih0jWPkGgBBAQ")
		oCascadeTree:SetProperty("BackColorSortBar",oCascadeTree:BackColor())
		oCascadeTree:SetProperty("ScrollPartVisible",0/*exVScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",1/*exHScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",2/*exScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:ScrollWidth := 4
		oCascadeTree:SetProperty("Background",276/*exVSBack*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oCascadeTree:SetProperty("Background",260/*exVSThumb*/,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oCascadeTree:ScrollHeight := 4
		oCascadeTree:SetProperty("Background",404/*exHSBack*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",388/*exHSThumb*/,oCascadeTree:Background(260/*exVSThumb*/))
		oCascadeTree:SetProperty("Background",511/*exScrollSizeGrip*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:SetProperty("Background",142/*exCSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",141/*exHSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",170/*exSplitBarSize*/,AutomationTranslateColor( GraMakeRGBColor  ( { 4,0,0 } )  , .F. ))
		oCascadeTree:SetProperty("Background",0/*0x0+*/,0x1000000)
		oCascadeTree:SetProperty("Background",1/*0x1+*/,0x2000000)
		oCascadeTree:SetProperty("Background",32/*0x20+*/,-1)
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
64
GroupBy sample

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oColumn,oColumn1,oColumn2
	LOCAL oView,oView1,oView2
	LOCAL bGroupBy,nSelected
	oCascadeTree:View():HeaderHeight := 24
	oView := oCascadeTree:DefaultView()
		oView1 := oView:View("State")
			oView1:BeginUpdate()
			oView1:SingleSel := .F.
			oView1:ColumnAutoResize := .T.
			oView1:Columns:Item(0):Visible := .F.
			oView1:Columns:Item(1):Visible := .F.
			oColumn := oView1:Columns:Item(2)
				oColumn:HTMLCaption := "State <off 4><fgcolor=808080>Name"
				oColumn:SortOrder := 1/*SortAscending*/
			oView1:EndUpdate()
		oView2 := oView:View("City")
			nSelected := oView2:ParentView:Items():SelectCount()
			bGroupBy := oCascadeTree:FormatABC("value > 1 ? -1 : 0",nSelected)
			oView2:BeginUpdate()
			oView2:SingleSel := .F.
			oView2:SortBarCaption := "Drag a <b>column</b> header here to group by that column."
			oView2:HasLines := 1/*exSolidLine*/
			oView2:ColumnAutoResize := .F.
			oView2:DrawGridLines := 2/*exVLines*/
			oView2:GridLineStyle := 32/*exGridLinesVSolid*/
			oView2:Columns:Item("CountryCode"):Visible := .F.
			oColumn1 := oView2:Columns:Item("Name")
				oColumn1:HTMLCaption := "City <off 4><fgcolor=808080>Name"
				oColumn1:Width := 128
				oColumn1:SortOrder := 1/*SortAscending*/
			oView2:SearchColumnIndex := 2
			oView2:TreeColumnIndex := oView2:SearchColumnIndex()
			oView2:SingleSort := .F.
			oView2:AllowGroupBy := .F.
			oView2:SortBarVisible := .F.
			oColumn2 := oView2:Columns:Item("StateCode")
				oColumn2:Visible := .F.
				oColumn2:SortOrder := 1/*SortAscending*/
			oView2:Width := oView2:WidthToFit()
			oView2:EndUpdate()
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oAppearance
	LOCAL oColumn
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oAppearance := oCascadeTree:VisualAppearance()
			oAppearance:Add(1,"C:\Program Files\Exontrol\ExCascadeTree\Sample\EBN\Assorted\vistaselDark.ebn")
			oAppearance:Add(2,"C:\Program Files\Exontrol\ExCascadeTree\Sample\EBN\Assorted\bhframe.ebn")
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.mdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "RO\CJ|BV|GL|IL"
		oView := oCascadeTree:DefaultView():View("Country")
			oView:BeginUpdate()
			oView:ColumnAutoResize := .T.
			oView:Columns:Item(0):Visible := .F.
			oColumn := oView:Columns:Item(1)
				oColumn:HTMLCaption := "Country <off 4><fgcolor=808080>Name"
				oColumn:SortOrder := 1/*SortAscending*/
			oView:EndUpdate()
		oCascadeTree:SetProperty("SelBackColor",0x1000000)
		oCascadeTree:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
		oCascadeTree:SetProperty("BackColorHeader",0x2000000)
		oCascadeTree:SetProperty("BackColorSortBar",oCascadeTree:BackColor())
		oCascadeTree:SetProperty("BackColorSortBarCaption",oCascadeTree:BackColor())
		oCascadeTree:SetProperty("ScrollPartVisible",0/*exVScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",1/*exHScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",2/*exScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:ScrollWidth := 4
		oCascadeTree:SetProperty("Background",276/*exVSBack*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oCascadeTree:SetProperty("Background",260/*exVSThumb*/,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oCascadeTree:ScrollHeight := 4
		oCascadeTree:SetProperty("Background",404/*exHSBack*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",388/*exHSThumb*/,oCascadeTree:Background(260/*exVSThumb*/))
		oCascadeTree:SetProperty("Background",511/*exScrollSizeGrip*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:SetProperty("Background",142/*exCSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",141/*exHSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",170/*exSplitBarSize*/,AutomationTranslateColor( GraMakeRGBColor  ( { 4,0,0 } )  , .F. ))
		oCascadeTree:SetProperty("BackColorSortBar",oCascadeTree:BackColor())
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
63
Manual sample

PROCEDURE OnCreateView(oCascadeTree,V)
	LOCAL oItems
	LOCAL oView
	LOCAL k
	oView := oCascadeTree:View()
		oView:BeginUpdate()
		k := oView:ParentView:Value()
		oView:HeaderVisible := .F.
		oView:ColumnAutoResize := .T.
		oView:ScrollBySingleLine := .T.
		oView:Columns():Add("Default"):SetProperty("Def",16/*exCellSingleLine*/,.F.)
		oView:Key := 0
		oItems := oView:Items()
			oItems:AddItem(oCascadeTree:FormatABC("A + `.Child 1`",k))
			oItems:AddItem(oCascadeTree:FormatABC("A + `.Child 2`",k))
			oItems:AddItem(oCascadeTree:FormatABC("A + `.Child 3`",k))
		oView:EndUpdate()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oItems
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|V| OnCreateView(oCascadeTree,V)} /*A view has been created.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:SetProperty("BackColorAlternate",0x7ff0f0f0)
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oView := oCascadeTree:DefaultView()
			oView:BeginUpdate()
			oView:HeaderVisible := .F.
			oView:ColumnAutoResize := .T.
			oView:ScrollBySingleLine := .T.
			oView:Columns():Add("Default"):SetProperty("Def",16/*exCellSingleLine*/,.F.)
			oView:Key := 0
			oItems := oView:Items()
				oItems:AddItem("Item A")
				oItems:AddItem("Item B")
				oItems:AddItem("Item C")
			oView:EndUpdate()
		oCascadeTree:Select := "Item A\Item*A*2\Item*A*2*3\"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
62
Appearance sample

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oColumn,oColumn1
	LOCAL oItems,oItems1
	LOCAL oView,oView1,oView2
	LOCAL h
	oCascadeTree:View():HeaderHeight := 24
	oView := oCascadeTree:DefaultView()
		oView1 := oView:View("State")
			oView1:BeginUpdate()
			oView1:ColumnAutoResize := .T.
			oView1:Columns:Item(0):Visible := .F.
			oView1:Columns:Item(1):Visible := .F.
			oColumn := oView1:Columns:Item(2)
				oColumn:HTMLCaption := "State <off 4><fgcolor=808080>Name"
				oColumn:SortOrder := 1/*SortAscending*/
			oItems := oView1:Items()
				oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
				h := oItems:LockedItem(0/*exTop*/,0)
				oItems:SetProperty("ItemDivider",h,0)
				oItems:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
				oItems:SetProperty("CellValue",h,0,"count(all,all,1)")
				oItems:SetProperty("FormatCell",h,0,"`<r>States: <b>`+ (value format `0`)")
			oView1:EndUpdate()
		oView2 := oView:View("City")
			oView2:BeginUpdate()
			oView2:SingleSel := .F.
			oView2:ColumnAutoResize := .F.
			oView2:DrawGridLines := 2/*exVLines*/
			oView2:GridLineStyle := 32/*exGridLinesVSolid*/
			oView2:Columns:Item(0):Visible := .F.
			oView2:Columns:Item(1):Visible := .F.
			oColumn1 := oView2:Columns:Item(2)
				oColumn1:HTMLCaption := "City <off 4><fgcolor=808080>Name"
				oColumn1:Width := 128
				oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
				oColumn1:SortOrder := 1/*SortAscending*/
			oView2:SearchColumnIndex := 2
			oView2:ConditionalFormats():Add("%CS2 = 1"):Bold := .T.
			oItems1 := oView2:Items()
				oItems1:SetProperty("LockedItemCount",0/*exTop*/,1)
				h := oItems1:LockedItem(0/*exTop*/,0)
				oItems1:SetProperty("ItemDivider",h,0)
				oItems1:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
				oItems1:SetProperty("CellValue",h,0,"count(all,all,1)")
				oItems1:SetProperty("FormatCell",h,0,"`<r>Cities: <b>`+ (value format `0`)")
			oView2:Width := oView2:WidthToFit()
			oView2:EndUpdate()
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oAppearance
	LOCAL oColumn
	LOCAL oItems
	LOCAL oView
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oAppearance := oCascadeTree:VisualAppearance()
			oAppearance:Add(1,"C:\Program Files\Exontrol\ExCascadeTree\Sample\EBN\MSOffice-Ribbon\msor_select.ebn")
			oAppearance:Add(2,"C:\Program Files\Exontrol\ExCascadeTree\Sample\EBN\MSOffice-Ribbon\msor_background.ebn")
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.mdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oView := oCascadeTree:DefaultView():View("Country")
			oView:BeginUpdate()
			oView:ColumnAutoResize := .T.
			oView:Columns:Item(0):Visible := .F.
			oColumn := oView:Columns:Item(1)
				oColumn:HTMLCaption := "Country <off 4><fgcolor=808080>Name"
				oColumn:SortOrder := 1/*SortAscending*/
			oItems := oView:Items()
				oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
				h := oItems:LockedItem(0/*exTop*/,0)
				oItems:SetProperty("ItemDivider",h,0)
				oItems:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
				oItems:SetProperty("CellValue",h,0,"count(all,all,1)")
				oItems:SetProperty("FormatCell",h,0,"`<r>Countries: <b>`+ (value format `0`)")
			oView:EndUpdate()
		oCascadeTree:SetProperty("SelBackColor",0x1000000)
		oCascadeTree:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,0 } )  , .F. ))
		oCascadeTree:SetProperty("BackColorHeader",0x2000000)
		oCascadeTree:SetProperty("ScrollPartVisible",0/*exVScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",1/*exHScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",2/*exScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:ScrollWidth := 4
		oCascadeTree:SetProperty("Background",276/*exVSBack*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oCascadeTree:SetProperty("Background",260/*exVSThumb*/,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oCascadeTree:ScrollHeight := 4
		oCascadeTree:SetProperty("Background",404/*exHSBack*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",388/*exHSThumb*/,oCascadeTree:Background(260/*exVSThumb*/))
		oCascadeTree:SetProperty("Background",511/*exScrollSizeGrip*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:SetProperty("Background",142/*exCSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",141/*exHSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",170/*exSplitBarSize*/,AutomationTranslateColor( GraMakeRGBColor  ( { 4,0,0 } )  , .F. ))
		oCascadeTree:SetProperty("BackColorSortBar",oCascadeTree:BackColor())
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
61
How can I get the selected items (sample 2)
PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oItems
	LOCAL oView
	LOCAL k
	oView := oCascadeTree:View()
		k := oView:ParentView:Value()
		oView:BeginUpdate()
		oView:ColumnAutoResize := .T.
		oView:Key := -1
		oView:Columns():Add(Transform(k,""))
		oItems := oView:Items()
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 1`",k))
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 2`",k))
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 3`",k))
		oView:EndUpdate()
RETURN

PROCEDURE OnViewItemStateEndChanging(oCascadeTree,Operation,Item,ColIndex)
	LOCAL oItems
	DevOut( "End" )
	DevOut( Transform(Operation,"") )
	oItems := oCascadeTree:View():Items()
		DevOut( "FocusItem" )
		DevOut( oItems:CellCaption(oItems:FocusItem(),0) )
		DevOut( "SelectedItem" )
		DevOut( oItems:CellCaption(oItems:SelectedItem(0),0) )
RETURN

PROCEDURE OnViewItemStateStartChanging(oCascadeTree,Operation,Item,ColIndex,Cancel)
	DevOut( "Start" )
	DevOut( Transform(Operation,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oItems
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:ViewItemStateEndChanging := {|Operation,Item,ColIndex| OnViewItemStateEndChanging(oCascadeTree,Operation,Item,ColIndex)} /*Indicates that the state of the item has been changed.*/
		oCascadeTree:ViewItemStateStartChanging := {|Operation,Item,ColIndex,Cancel| OnViewItemStateStartChanging(oCascadeTree,Operation,Item,ColIndex,Cancel)} /*Indicates that the state of the item is about to be changed.*/

		oCascadeTree:BeginUpdate()
		oView := oCascadeTree:View()
			oView:BeginUpdate()
			oView:ColumnAutoResize := .T.
			oView:Columns():Add("Default")
			oView:Key := 0
			oView:LinesAtRoot := -1/*exLinesAtRoot*/
			oItems := oView:Items()
				oItems:AddItem("Item A")
				oItems:SetProperty("SelectItem",oItems:AddItem("Item B"),.T.)
				oItems:AddItem("Item C")
			oView:EndUpdate()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
60
How do I specify a foreground color for a particular view

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:DefaultView():ConditionalFormats():Add("1"):SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
59
How do display result/items in the view's filter bar

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oColumn,oColumn1,oColumn2,oColumn3
	LOCAL oView,oView1,oView2,oView3,oView4,oView5
	oView := oCascadeTree:View()
		oView:HeaderAppearance := 4/*Etched*/
		oView:HeaderHeight := 24
		oView:DrawGridLines := -1/*exAllLines*/
		oView:GridLineStyle := 12/*exGridLinesDash*/
	oView1 := oCascadeTree:DefaultView()
		oView2 := oView1:View("Country")
			oView2:BeginUpdate()
			oView2:ColumnAutoResize := .T.
			oView2:Columns:Item(0):Visible := .F.
			oColumn := oView2:Columns:Item(1)
				oColumn:HTMLCaption := "Country <off 4><fgcolor=808080>Name"
				oColumn:DisplayFilterButton := .T.
				oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
				oColumn:FilterBarDropDownWidth := 2
			oView2:EndUpdate()
		oView3 := oView1:View("State")
			oView3:BeginUpdate()
			oView3:ColumnAutoResize := .T.
			oView3:Columns:Item(0):Visible := .F.
			oView3:Columns:Item(1):Visible := .F.
			oColumn1 := oView3:Columns:Item(2)
				oColumn1:HTMLCaption := "State <off 4><fgcolor=808080>Name"
				oColumn1:DisplayFilterButton := .T.
				oColumn1:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
				oColumn1:FilterBarDropDownWidth := 2
			oView3:EndUpdate()
		oView4 := oView1:View("City")
			oView4:BeginUpdate()
			oView4:Columns:Item(0):Visible := .F.
			oView4:Columns:Item(1):Visible := .F.
			oColumn2 := oView4:Columns:Item(2)
				oColumn2:HTMLCaption := "City <off 4><fgcolor=808080>Name"
				oColumn2:Width := 128
				oColumn2:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
				oColumn2:DisplayFilterButton := .T.
				oColumn2:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
				oColumn2:FilterBarDropDownWidth := 2
			oColumn3 := oView4:Columns():Add("Pos")
				oColumn3:AllowSizing := .F.
				oColumn3:Width := 32
				oColumn3:SetProperty("Def",4/*exCellBackColor*/,15790320)
				oColumn3:Position := 0
				oColumn3:FormatColumn := "1 pos ``"
			oView4:CountLockedColumns := 1
			oView4:EndUpdate()
	oView5 := oCascadeTree:View()
		oView5:FilterBarHeight := 36
		oView5: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)`) )))"
		oView5:FilterBarPromptType := 3/*exFilterPromptStartWith*/
		oView5:FilterBarPromptVisible := 515/*exFilterBarShowCloseIfRequired+exFilterBarVisible+exFilterBarPromptVisible*/
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:SetProperty("ScrollPartVisible",0/*exVScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",1/*exHScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",2/*exScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:ScrollWidth := 4
		oCascadeTree:SetProperty("Background",276/*exVSBack*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oCascadeTree:SetProperty("Background",260/*exVSThumb*/,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oCascadeTree:ScrollHeight := 4
		oCascadeTree:SetProperty("Background",404/*exHSBack*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",388/*exHSThumb*/,oCascadeTree:Background(260/*exVSThumb*/))
		oCascadeTree:SetProperty("Background",511/*exScrollSizeGrip*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:SetProperty("Background",142/*exCSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",141/*exHSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",170/*exSplitBarSize*/,AutomationTranslateColor( GraMakeRGBColor  ( { 2,0,0 } )  , .F. ))
		oCascadeTree:EndUpdate()
		oCascadeTree:BeginUpdate()
		oCascadeTree:MinColumnWidth := 348
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oView := oCascadeTree:DefaultView():View("City")
			oView:FilterBarPromptPattern := "An"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
58
I am using the filter prompt feature, the question is how can I filter for items that starts with typed characters rather than contains

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oView
	oView := oCascadeTree:View()
		oView:FilterBarPromptType := 3/*exFilterPromptStartWith*/
		oView:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oColumn
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oView := oCascadeTree:DefaultView():View("City")
			oView:FilterBarPromptPattern := "An"
			oColumn := oView:Columns:Item("Name")
				oColumn:Width := 128
				oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
				oColumn:FormatColumn := "value replace `An` with `<bgcolor=000000><fgcolor=FFFFFF>An</fgcolor></bgcolor>` "
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
57
FilterBarCaption Predefined Keywords

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oColumn,oColumn1,oColumn2
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:SetProperty("BackColorAlternate",AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oCascadeTree:Mode := 1/*exSingleCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US"
		oView := oCascadeTree:DefaultView():View("Country")
			oColumn := oView:Columns():Add("Pos")
				oColumn:Position := 0
				oColumn:Width := 32
				oColumn:AllowSizing := .F.
				oColumn:FormatColumn := "1pos ``"
			oColumn1 := oView:Columns:Item("CountryCode")
				oColumn1:Width := 32
				oColumn1:AllowSizing := .F.
				oColumn1:DisplayFilterButton := .T.
			oColumn2 := oView:Columns:Item("CountryName")
				oColumn2:DisplayFilterButton := .T.
				oColumn2:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
				oColumn2:FilterBarDropDownWidth := 2
				oColumn2:FilterType := 240/*exFilter*/
				oColumn2:Filter := "Italy|Romania|Germany"
			oView:FilterBarPromptPattern := "a"
			oView:ColumnAutoResize := .T.
			oView:SearchColumnIndex := oView:Columns:Item("CountryName"):Index()
			oView:FilterInclude := 1/*exItemsWithChilds*/
			oView: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>`+ `<br><fgcolor=0000FF><i>leafitemcount</i></fgcolor>: <fgcolor=808080>` + leafitemcount + `</fgcolor>`"
			oView:FilterBarPromptVisible := 7/*exFilterBarCaptionVisible+exFilterBarVisible+exFilterBarPromptVisible*/
			oView:ApplyFilter()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
56
How can I enable the column's filter bar (view)

PROCEDURE OnCreateView(oCascadeTree,View)
	oCascadeTree:View():FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oColumn
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oView := oCascadeTree:DefaultView():View("Country")
			oView:ColumnAutoResize := .T.
			oView:Columns:Item("CountryCode"):Visible := .F.
			oColumn := oView:Columns:Item("CountryName")
				oColumn:DisplayFilterButton := .T.
				oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
				oColumn:FilterBarDropDownWidth := 2
				oColumn:FilterType := 240/*exFilter*/
				oColumn:Filter := "Romania|Germany"
			oView:ApplyFilter()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
55
How can I enable the column's filter bar

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oColumn,oColumn1
	LOCAL oView,oView1
	oView := oCascadeTree:View()
		oView:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/
		oColumn := oView:Columns:Item(0)
			oColumn:DisplayFilterButton := .T.
			oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/
			oColumn:FilterBarDropDownWidth := 2
	oView1 := oCascadeTree:DefaultView():View("Country")
		oColumn1 := oView1:Columns:Item(0)
			oColumn1:FilterType := 240/*exFilter*/
			oColumn1:Filter := "US|RO|GE"
		oView1:ApplyFilter()
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
54
How can I enable the control's filter bar (view)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:DefaultView():FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
53
How can I enable the control's filter bar

PROCEDURE OnCreateView(oCascadeTree,View)
	oCascadeTree:View():FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
52
Aggregate sum, min, max, count, avg, divider, total (view)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oItems
	LOCAL oView
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 2/*exSplitEqualCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:SetProperty("Background",170/*exSplitBarSize*/,AutomationTranslateColor( GraMakeRGBColor  ( { 4,0,0 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "RO"
		oView := oCascadeTree:DefaultView():View("Country")
			oView:BeginUpdate()
			oView:ColumnAutoResize := .T.
			oView:Columns:Item(0):Visible := .F.
			oItems := oView:Items()
				oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
				h := oItems:LockedItem(0/*exTop*/,0)
				oItems:SetProperty("ItemDivider",h,0)
				oItems:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
				oItems:SetProperty("CellValue",h,0,"count(all,all,1)")
				oItems:SetProperty("FormatCell",h,0,"`<r>Countries: <b>`+ (value format `0`)")
			oView:EndUpdate()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
51
Aggregate sum, min, max, count, avg, divider, total

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oColumn
	LOCAL oItems,oItems1,oItems2
	LOCAL oView,oView1,oView2,oView3
	LOCAL h
	oCascadeTree:View():HeaderVisible := .F.
	oView := oCascadeTree:DefaultView()
		oView1 := oView:View("Country")
			oView1:BeginUpdate()
			oView1:ColumnAutoResize := .T.
			oView1:Columns:Item(0):Visible := .F.
			oItems := oView1:Items()
				oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
				h := oItems:LockedItem(0/*exTop*/,0)
				oItems:SetProperty("ItemDivider",h,0)
				oItems:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
				oItems:SetProperty("CellValue",h,0,"count(all,all,1)")
				oItems:SetProperty("FormatCell",h,0,"`<r>Countries: <b>`+ (value format `0`)")
			oView1:EndUpdate()
		oView2 := oView:View("State")
			oView2:BeginUpdate()
			oView2:SingleSel := .F.
			oView2:ColumnAutoResize := .T.
			oView2:Columns:Item(0):Visible := .F.
			oView2:Columns:Item(1):Visible := .F.
			oItems1 := oView2:Items()
				oItems1:SetProperty("LockedItemCount",0/*exTop*/,1)
				h := oItems1:LockedItem(0/*exTop*/,0)
				oItems1:SetProperty("ItemDivider",h,0)
				oItems1:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
				oItems1:SetProperty("CellValue",h,0,"count(all,all,1)")
				oItems1:SetProperty("FormatCell",h,0,"`<r>States: <b>`+ (value format `0`)")
			oView2:EndUpdate()
		oView3 := oView:View("City")
			oView3:BeginUpdate()
			oView3:Columns:Item(0):Visible := .F.
			oView3:Columns:Item(1):Visible := .F.
			oColumn := oView3:Columns:Item(2)
				oColumn:Width := 128
				oColumn:HTMLCaption := "CityName"
			oItems2 := oView3:Items()
				oItems2:SetProperty("LockedItemCount",0/*exTop*/,1)
				h := oItems2:LockedItem(0/*exTop*/,0)
				oItems2:SetProperty("ItemDivider",h,0)
				oItems2:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/)
				oItems2:SetProperty("CellValue",h,0,"count(all,all,1)")
				oItems2:SetProperty("FormatCell",h,0,"`<r>Cities: <b>`+ (value format `0`)")
			oView3:EndUpdate()
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:SetProperty("Background",170/*exSplitBarSize*/,AutomationTranslateColor( GraMakeRGBColor  ( { 4,0,0 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
50
How can I add a check-box column (view)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oColumn,oColumn1
	LOCAL oConditionalFormat
	LOCAL oConditionalFormats
	LOCAL oItems
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<c>Select multiple-items in the City view, and press <b>SPACE</b> key"
		oCascadeTree:SetProperty("Background",168/*exStatusBackColor*/,oCascadeTree:BackColor())
		oCascadeTree:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhABO0GACAADACAxRDgMQBQKAAzAJBIYhiG4cYCgMYxXDOCYXABCEYRXBKUQSDqEYyjGLIXAWCYSAAMIwDKAUEhqGiUBihaQhRgyJI3RlJGaoDiKIokShKEpDLKlCx3H6OKQjOZgAoySo4SbDMp0NAkRBlFqcJCCCLAUgmTpQUBOYyiLKNRxQGoYLIlayZIiSIpMRbWcB3BYEOSFFasAAleYZTg2Jp1TbPAAYFL1ISDKSiIZqTA6PheT5yUzCNazbgEMTvRKqcSnO6bOgnEKQZKAGg4bg1RTVAYZLKtPR7aqyUJvZ5sMB6DiuLYRPKXZoucaNExSS5ebJtOzQJbEXBpXSpBwzSieBozIaQcJUOoaVxPFkaJrGuIx3h2BZPgOUIQmUcIwDARAkiAaQxh0DonCMLAeBKZobBCCY+niWJaBIKJJH4MoBgiQpCmmUR/ooBgCgCYBIBYBoBmCBYAn+ApgkgNgOgOYQIEYBIEGESBWBS" +;
		"BJhGgZgZgYIYoHYEIHCGaIGAuCAiCgegkgkYYoh4KIFiKKIuBeAJimiGgwgwYoYk4NILCCGJmDqDpjkidg+gGTo1jUAxAEAgI")
		oCascadeTree:SetProperty("SelBackColor",0x1000000)
		oCascadeTree:SetProperty("SelForeColor",oCascadeTree:ForeColor())
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oView := oCascadeTree:DefaultView():View("City")
			oView:BeginUpdate()
			oView:ShowFocusRect := .F.
			oView:SingleSel := .F.
			oView:Columns:Item(0):Visible := .F.
			oView:Columns:Item(1):Visible := .F.
			oColumn := oView:Columns:Item(2)
				oColumn:HTMLCaption := "City <off 4><fgcolor=808080>Name"
				oColumn:Width := 128
				oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
			oView:SearchColumnIndex := oView:Columns:Item("Name"):Index()
			oColumn1 := oView:Columns():Add("Pos")
				oColumn1:Position := 0
				oColumn1:Width := 32
				oColumn1:FormatColumn := "1 pos ``"
			oConditionalFormats := oView:ConditionalFormats()
				oConditionalFormats:Add("%CS2 = 1"):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 190,190,190 } )  , .F. ))
				oConditionalFormat := oConditionalFormats:Add("%CS2 = 1")
					oConditionalFormat:Bold := .T.
					oConditionalFormat:ApplyTo := 8/*0x8+*/
			oItems := oView:Items()
				oItems:SetProperty("CellState",oItems:ItemByIndex(1),2,1)
				oItems:SetProperty("CellState",oItems:ItemByIndex(3),2,1)
				oItems:SetProperty("CellState",oItems:ItemByIndex(5),2,1)
			oView:EndUpdate()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
49
How can I add a check-box column

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oColumn,oColumn1
	LOCAL oConditionalFormat
	LOCAL oConditionalFormats
	LOCAL oItems
	LOCAL oView,oView1,oView2,oView3,oView4
	oView := oCascadeTree:View()
		oView:HeaderAppearance := 4/*Etched*/
		oView:HeaderHeight := 24
		oView:DrawGridLines := 2/*exVLines*/
		oView:GridLineStyle := 12/*exGridLinesDash*/
	oView1 := oCascadeTree:DefaultView()
		oView2 := oView1:View("Country")
			oView2:BeginUpdate()
			oView2:ColumnAutoResize := .T.
			oView2:Columns:Item(0):Visible := .F.
			oView2:Columns:Item(1):HTMLCaption := "Country <off 4><fgcolor=808080>Name"
			oView2:EndUpdate()
		oView3 := oView1:View("State")
			oView3:BeginUpdate()
			oView3:ColumnAutoResize := .T.
			oView3:Columns:Item(0):Visible := .F.
			oView3:Columns:Item(1):Visible := .F.
			oView3:Columns:Item(2):HTMLCaption := "State <off 4><fgcolor=808080>Name"
			oView3:EndUpdate()
		oView4 := oView1:View("City")
			oView4:BeginUpdate()
			oView4:ShowFocusRect := .F.
			oView4:SingleSel := .F.
			oView4:Columns:Item(0):Visible := .F.
			oView4:Columns:Item(1):Visible := .F.
			oColumn := oView4:Columns:Item(2)
				oColumn:HTMLCaption := "City <off 4><fgcolor=808080>Name"
				oColumn:Width := 128
				oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
			oView4:SearchColumnIndex := oView4:Columns:Item("Name"):Index()
			oColumn1 := oView4:Columns():Add("Pos")
				oColumn1:Position := 0
				oColumn1:Width := 32
				oColumn1:FormatColumn := "1 pos ``"
			oConditionalFormats := oView4:ConditionalFormats()
				oConditionalFormats:Add("%CS2 = 1"):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 190,190,190 } )  , .F. ))
				oConditionalFormat := oConditionalFormats:Add("%CS2 = 1")
					oConditionalFormat:Bold := .T.
					oConditionalFormat:ApplyTo := 8/*0x8+*/
			oItems := oView4:Items()
				oItems:SetProperty("CellState",oItems:ItemByIndex(1),2,1)
				oItems:SetProperty("CellState",oItems:ItemByIndex(3),2,1)
				oItems:SetProperty("CellState",oItems:ItemByIndex(5),2,1)
			oView4:EndUpdate()
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<c>Select multiple-items in the City view, and press <b>SPACE</b> key"
		oCascadeTree:SetProperty("Background",168/*exStatusBackColor*/,oCascadeTree:BackColor())
		oCascadeTree:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhABO0GACAADACAxRDgMQBQKAAzAJBIYhiG4cYCgMYxXDOCYXABCEYRXBKUQSDqEYyjGLIXAWCYSAAMIwDKAUEhqGiUBihaQhRgyJI3RlJGaoDiKIokShKEpDLKlCx3H6OKQjOZgAoySo4SbDMp0NAkRBlFqcJCCCLAUgmTpQUBOYyiLKNRxQGoYLIlayZIiSIpMRbWcB3BYEOSFFasAAleYZTg2Jp1TbPAAYFL1ISDKSiIZqTA6PheT5yUzCNazbgEMTvRKqcSnO6bOgnEKQZKAGg4bg1RTVAYZLKtPR7aqyUJvZ5sMB6DiuLYRPKXZoucaNExSS5ebJtOzQJbEXBpXSpBwzSieBozIaQcJUOoaVxPFkaJrGuIx3h2BZPgOUIQmUcIwDARAkiAaQxh0DonCMLAeBKZobBCCY+niWJaBIKJJH4MoBgiQpCmmUR/ooBgCgCYBIBYBoBmCBYAn+ApgkgNgOgOYQIEYBIEGESBWBS" +;
		"BJhGgZgZgYIYoHYEIHCGaIGAuCAiCgegkgkYYoh4KIFiKKIuBeAJimiGgwgwYoYk4NILCCGJmDqDpjkidg+gGTo1jUAxAEAgI")
		oCascadeTree:SetProperty("SelBackColor",0x1000000)
		oCascadeTree:SetProperty("SelForeColor",oCascadeTree:ForeColor())
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
48
How can I access a view

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oColumn
	LOCAL oView,oView1,oView2,oView3,oView4
	oView := oCascadeTree:View()
		oView:HeaderAppearance := 4/*Etched*/
		oView:HeaderHeight := 24
		oView:DrawGridLines := -1/*exAllLines*/
		oView:GridLineStyle := 12/*exGridLinesDash*/
	oView1 := oCascadeTree:DefaultView()
		oView2 := oView1:View("Country")
			oView2:BeginUpdate()
			oView2:ColumnAutoResize := .T.
			oView2:Columns:Item(0):Visible := .F.
			oView2:Columns:Item(1):HTMLCaption := "Country <off 4><fgcolor=808080>Name"
			oView2:EndUpdate()
		oView3 := oView1:View("State")
			oView3:BeginUpdate()
			oView3:ColumnAutoResize := .T.
			oView3:Columns:Item(0):Visible := .F.
			oView3:Columns:Item(1):Visible := .F.
			oView3:Columns:Item(2):HTMLCaption := "State <off 4><fgcolor=808080>Name"
			oView3:EndUpdate()
		oView4 := oView1:View("City")
			oView4:BeginUpdate()
			oView4:Columns:Item(0):Visible := .F.
			oView4:Columns:Item(1):Visible := .F.
			oColumn := oView4:Columns:Item(2)
				oColumn:HTMLCaption := "City <off 4><fgcolor=808080>Name"
				oColumn:Width := 128
				oColumn:SetProperty("Def",4/*exCellBackColor*/,15790320)
			oView4:CountLockedColumns := 1
			oView4:EndUpdate()
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
47
Conditional Format (check)

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oConditionalFormat
	LOCAL oItems
	LOCAL oView
	oView := oCascadeTree:View()
		oConditionalFormat := oView:ConditionalFormats():Add("%CS0 = 1")
			oConditionalFormat:Bold := .T.
		oView:Columns:Item(0):SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
		oItems := oView:Items()
			oItems:SetProperty("CellState",oItems:FocusItem(),0,1)
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
46
Conditional Format (view)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oConditionalFormat
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oView := oCascadeTree:DefaultView():View("City")
			oConditionalFormat := oView:ConditionalFormats():Add("(%0 = `US`) and (%2 like `Al*`)")
				oConditionalFormat:Bold := .T.
				oConditionalFormat:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
45
Conditional Format

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oConditionalFormat
	LOCAL oView
	oView := oCascadeTree:View()
		oConditionalFormat := oView:ConditionalFormats():Add("%0 = `US`")
			oConditionalFormat:Bold := .T.
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
44
I've seen the AllowSplitView property, the question is how can I load data to

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oObject

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:AllowSplitView := 1/*exAllowOneSplitView*/
		oCascadeTree:SplitViewHeight := Transform(256,"")
		oObject := oCascadeTree:DefaultView(1)
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
43
How can I group the items (view)

PROCEDURE OnCreateView(oCascadeTree,View)
	oCascadeTree:View():SingleSel := .F.
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oAppearance
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oAppearance := oCascadeTree:VisualAppearance()
			oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABa0GACAADACAxRDgMQBQKAAzAJBIYhiG4cYCgMYxXDOCYXABCEYRXBIZQ7BKNIxjSJwFgkAoJDYOMjwlDKEgADDFEgjJBkRxtDCPIDnGQoDiGI4vSrCQ4yDA8GxCGSfIrjKiYbiGNY8RgZCiOMAFJSpC6gZRoSq4doGGJLQiDMaAdBNHyZKqpbQqeCZPDINQlWzbcrjKKFYQTOi7I4sCbYcqKA5PTbNdYyVBMWxfGIbaIkXAcBjuO4hWbFdASRQdDYtHTIbzjCxLcgMD4gRwW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sgYYpoj4F4MGMKBWDSDRhngMg4gcIQYnYPoEE6N4ZAMQBAICA=")
		oCascadeTree:SetProperty("SelBackColor",0x1000000)
		oCascadeTree:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,0 } )  , .F. ))
		oCascadeTree:SetProperty("BackColorHeader",0x2000000)
		oCascadeTree:SetProperty("ScrollPartVisible",0/*exVScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",1/*exHScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",2/*exScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:ScrollWidth := 4
		oCascadeTree:SetProperty("Background",276/*exVSBack*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oCascadeTree:SetProperty("Background",260/*exVSThumb*/,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oCascadeTree:ScrollHeight := 4
		oCascadeTree:SetProperty("Background",404/*exHSBack*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",388/*exHSThumb*/,oCascadeTree:Background(260/*exVSThumb*/))
		oCascadeTree:SetProperty("Background",511/*exScrollSizeGrip*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:SetProperty("Background",142/*exCSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",141/*exHSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",170/*exSplitBarSize*/,AutomationTranslateColor( GraMakeRGBColor  ( { 2,0,0 } )  , .F. ))
		oCascadeTree:SetProperty("BackColorSortBar",oCascadeTree:BackColor())
		oCascadeTree:EndUpdate()
		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "RO\CJ|BV|CS"
		oView := oCascadeTree:DefaultView():View("City")
			oView:BeginUpdate()
			oColumns := oView:Columns()
				oColumns:Item("CountryCode"):Visible := .F.
				oColumn := oColumns:Item("Name")
					oColumn:SortOrder := 1/*SortAscending*/
					oColumn:Width := 128
			oView:SortBarVisible := .T.
			oView:AllowGroupBy := .T.
			oView:SingleSort := .F.
			oView:Columns:Item("StateCode"):SortOrder := 1/*SortAscending*/
			oView:TreeColumnIndex := oView:Columns:Item("Name"):Index()
			oView:EndUpdate()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
42
How can I group the items

PROCEDURE OnCreateView(oCascadeTree,View)
	/*Columns("StateCode").Visible = False*/
	/*Columns("StateName").SortOrder = 1*/
	/*Columns("StateCode").SortOrder = nGroupByIfCity*/
	LOCAL oView
	LOCAL bColumnAutoResize,nGroupByIfCity,oObject
	nGroupByIfCity := oCascadeTree:FormatABC("( A = `City`) ? 1 : 0",oCascadeTree:View:Tag())
	bColumnAutoResize := oCascadeTree:FormatABC(" (A = `City`) ? 0 : -1",oCascadeTree:View:Tag())
	oView := oCascadeTree:View()
		oView:BeginUpdate()
		oView:SingleSel := .F.
		oView:Columns:Item("CountryCode"):Visible := .F.
		oView:Columns:Item("CountryName"):SortOrder := 1/*SortAscending*/
		oObject := oView:Columns:Item(2)
		oView:TreeColumnIndex := 2
		oView:AllowGroupBy := .T.
		oView:SingleSort := .F.
		oView:SortBarVisible := .F.
		oView:ColumnAutoResize := .F.
		oView:EndUpdate()
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oAppearance

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oAppearance := oCascadeTree:VisualAppearance()
			oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABa0GACAADACAxRDgMQBQKAAzAJBIYhiG4cYCgMYxXDOCYXABCEYRXBIZQ7BKNIxjSJwFgkAoJDYOMjwlDKEgADDFEgjJBkRxtDCPIDnGQoDiGI4vSrCQ4yDA8GxCGSfIrjKiYbiGNY8RgZCiOMAFJSpC6gZRoSq4doGGJLQiDMaAdBNHyZKqpbQqeCZPDINQlWzbcrjKKFYQTOi7I4sCbYcqKA5PTbNdYyVBMWxfGIbaIkXAcBjuO4hWbFdASRQdDYtHTIbzjCxLcgMD4gRwWCYNSAGRZJLDKK4gSh6eorHQA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g4gcIQYnYPoEE6N4ZAMQBAICA=")
		oCascadeTree:SetProperty("SelBackColor",0x1000000)
		oCascadeTree:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,0 } )  , .F. ))
		oCascadeTree:SetProperty("BackColorHeader",0x2000000)
		oCascadeTree:SetProperty("ScrollPartVisible",0/*exVScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",1/*exHScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",2/*exScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:ScrollWidth := 4
		oCascadeTree:SetProperty("Background",276/*exVSBack*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oCascadeTree:SetProperty("Background",260/*exVSThumb*/,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oCascadeTree:ScrollHeight := 4
		oCascadeTree:SetProperty("Background",404/*exHSBack*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",388/*exHSThumb*/,oCascadeTree:Background(260/*exVSThumb*/))
		oCascadeTree:SetProperty("Background",511/*exScrollSizeGrip*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:SetProperty("Background",142/*exCSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",141/*exHSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",170/*exSplitBarSize*/,AutomationTranslateColor( GraMakeRGBColor  ( { 2,0,0 } )  , .F. ))
		oCascadeTree:SetProperty("BackColorSortBar",oCascadeTree:BackColor())
		oCascadeTree:EndUpdate()
		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "RO\CJ|BV|CS"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
41
How can I change the visual appearance of the selection/header

PROCEDURE OnCreateView(oCascadeTree,View)
	/*Columns("StateCode").Visible = False*/
	/*Columns("StateName").SortOrder = 1*/
	LOCAL oView
	LOCAL oObject
	oView := oCascadeTree:View()
		oView:BeginUpdate()
		oView:ColumnAutoResize := .T.
		oView:Columns:Item("CountryCode"):Visible := .F.
		oView:Columns:Item("CountryName"):SortOrder := 1/*SortAscending*/
		oObject := oView:Columns:Item("Name")
		oView:EndUpdate()
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oAppearance

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oAppearance := oCascadeTree:VisualAppearance()
			oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABWYDg6AADACAxRDgMQBQKAAzAJBIYhiG4cYCgMYxXDOCYXABCEYRXBIZQ7BKNIxjSJwFgmEgADCNAwgFBIcBhE4ZIKkEYoMiONoYR5Ac4yFAcQxHE6TZRgeDZToWN48TZLEB0VRFGL1J4AKbfKKKBiqIZDTpMdKSHIIFQ4BiEaYkGjqQpKVIdDSJMwWTI4ahhNSEbauCZ7DhyXpLUbeNSyXJsXw7GSOZJvGZ5bjuIY+RxQEK1NQkOyNOiOAosGCQWiDE4DWZZUT3XS+HgAGStY4rWCcSgOYIDZTPOT1DYtIY3NC5c7tS4bPq3NZHXTAeigBa4AZTQafcTvSA5OjOQQ2VhNWIXRxgAZ3YCNbzpTgsHeD5DmUQh3jSTQ/DuIZBh0bJ8BsG4WlsYwXjEapphuXh/HsRQJAQQhKAaEwZlCahyDKchJlEIgRDedQbA2EIQiECR3BudAgBgRgBgSHZQFSCwzECV4DGCeA6BCBJhCg" +;
		"VgRgWs4YkgNJKCOMJ2C0T4Dn4IIIiIGIOCaCRiy0HQ9iGIxMhgMAMmKZJ2D+SQThININgiM4In+DhPnIDJhD+RxzgCfwaE2c58F0N4PniSJ/guTJiCiOAygwCJODyDwIFifhVD+R5JBQcIREYOQgFgNwPnkRJ/qOIgIjEMYMFOVg9hESA5BQfYSCbQx1DcZA5lAXQ2vURh4hoT55hiRgfEqYwMkUPQPnGahgiGJwpmAdYeAaWZgGINoPnEWoQBKaQKAyf4gAwMZoisMIMGOTJ/B0KQK0EG5NhqDolBmKhRG6JQUX8GJYD+aZaBaGweAqEwEkYP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4H8ewRGWhLHsL0H4XgvASHMMkPY3g6C9FuB4P4+AvAJD0EwO4vA1CtHCBMDwEQZjmHwP4SIsgvh6D8C8II6h9geFyDUdQcwVCfF4G0C4xBvjBG2PwQg2RaBfH4MoTI9Rgh9HMNccY+BVDfC+NQL4kxFC3HOPgP4nwjjwBsIY" +;
		"AAnQ/hPHqP0XwiABgABABMdwgBHj1H0MACItgYAEHoAMPwUAWjbGAPEHgNhjAIE+IIKAFR9AVBwDAE44B+AbEEIULQDxgiBCAP4Q4Sx5CFBGOoCowhMBIBgEUAA2wMBCEMBQIQqA2gLBAKwGYhgoDRHuEIbAbwFigHoDMDYgwEBRCGFgOIERxAAH+IgMQiA3AMBwIsB4RhuAsEUCMUwKRZh4E2BMAwGBRiFAiFYFIRQRCtAmEUDgTQKCRDcC4YoSBeBUHGBAbgGBIiMFSI8XAqQNiGG4HARwEQ/A1GMKEJQVRDjYHUBsSI5gejHFQPkDoBQWB2BUMMeAeAHCJASCEUgLBDiQAGHQMQig0gGB4AcHghBJAyCEEkCoaQMApFILwR4kg5BuCUJUHILwRgQHiFMSQUhHBKCSAkFgMQig8EYBUCQPA5hICSFpKgeBzCUHEKANwjAwhTBAMcPgrRLgjHkF0ZYmQWgtFKKwW4lApDCCuEwLIYQXjFCYLUCochwB" +;
		"yGWMkTQOxzB4HKJccQrgyhMGSJ0Go5hCDTA2MMDwZRKgxH2DQEw+ByicBmIQVYTRYhXBsMUMIVhNjjEkHUZw0RvA5BOCgY4FRJiiDqE4BI7QcCmGSFMToExogVCcOkbIOxzhaBmJ0AYnA1AMdoCsKIJQEgfHoB4QQDAJCtCGGgHoEQMDiFtPIKQrAdDNHiAMEAICAgA==")
		oCascadeTree:SetProperty("SelBackColor",0x1000000)
		oCascadeTree:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,0 } )  , .F. ))
		oCascadeTree:SetProperty("BackColorHeader",0x2000000)
		oCascadeTree:SetProperty("ScrollPartVisible",0/*exVScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",1/*exHScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",2/*exScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:ScrollWidth := 4
		oCascadeTree:SetProperty("Background",276/*exVSBack*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oCascadeTree:SetProperty("Background",260/*exVSThumb*/,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oCascadeTree:ScrollHeight := 4
		oCascadeTree:SetProperty("Background",404/*exHSBack*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",388/*exHSThumb*/,oCascadeTree:Background(260/*exVSThumb*/))
		oCascadeTree:SetProperty("Background",511/*exScrollSizeGrip*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:SetProperty("Background",142/*exCSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",141/*exHSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",170/*exSplitBarSize*/,AutomationTranslateColor( GraMakeRGBColor  ( { 2,0,0 } )  , .F. ))
		oCascadeTree:SetProperty("BackColorSortBar",oCascadeTree:BackColor())
		oCascadeTree:EndUpdate()
		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "RO\CJ"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
40
How can I format a column so it display its content in a different way
PROCEDURE OnCreateView(oCascadeTree,View)
	/*Columns("StateCode").Visible = False*/
	LOCAL oView
	LOCAL oObject,oObject1,oObject2,oObject3
	oView := oCascadeTree:View()
		oView:BeginUpdate()
		oView:ContinueColumnScroll := .F.
		oView:ScrollBySingleLine := .T.
		oView:DrawGridLines := -1/*exAllLines*/
		oView:EnsureVisibleColumn("Date")
		oView:Columns:Item("CountryCode"):Visible := .F.
		oObject := oView:Columns:Item("Date")
		oObject1 := oView:Columns:Item("Function")
		oObject2 := oView:Columns:Item("Coordinates")
		oObject3 := oView:Columns:Item("Status")
		oView:EndUpdate()
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:FitCascadeColumns := 7
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:ScrollWidth := 4
		oCascadeTree:ScrollHeight := 4
		oCascadeTree:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\OR"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
39
How can I add a position column

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oColumn
	LOCAL oView
	oView := oCascadeTree:View()
		oColumn := oView:Columns():Add("Pos")
			oColumn:Width := 32
			oColumn:AllowSizing := .F.
			oColumn:Position := 0
			oColumn:FormatColumn := "1 pos ``"
			oColumn:SetProperty("Def",4/*exCellBackColor*/,15790320)
			oColumn:Alignment := 2/*RightAlignment*/
			oColumn:HeaderAlignment := oColumn:Alignment()
			oColumn:SetProperty("Def",49/*exCellPaddingRight*/,2)
			oColumn:SetProperty("Def",48/*exCellPaddingLeft*/,2)
			oColumn:SetProperty("Def",52/*exHeaderPaddingLeft*/,2)
			oColumn:SetProperty("Def",53/*exHeaderPaddingRight*/,2)
		oView:CountLockedColumns := 1
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\IA"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
38
How can I display icons or images

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oView
	LOCAL oObject
	oView := oCascadeTree:View()
		oView:EnsureVisibleColumn("Function")
		oObject := oView:Columns:Item("Function")
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\MN"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
37
How can I turn-on the control's status bar

PROCEDURE OnCreateView(oCascadeTree,View)
	oCascadeTree:StatusBarLabel := Transform(oCascadeTree:FormatABC("`<b>` + ( value replace `\\` with ` </b><font ;6><off 4>` )",oCascadeTree:Name()),"")
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

PROCEDURE OnViewEndChanging(oCascadeTree,Operation)
	oCascadeTree:StatusBarLabel := Transform(oCascadeTree:FormatABC("`<b>` + ( value replace `\\` with ` </b><font ;6><off 4>` )",oCascadeTree:Name()),"")
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/
		oCascadeTree:ViewEndChanging := {|Operation| OnViewEndChanging(oCascadeTree,Operation)} /*Occurs once the user is about to change the view.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarHeight := 24
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Name := "Romania\Cluj\Baciu*"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
36
How can I disable incremental searching
PROCEDURE OnCreateView(oCascadeTree,View)
	oCascadeTree:View():AutoSearch := .F.
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
35
ScrollBar extension

PROCEDURE OnCreateView(oCascadeTree,View)
	/*Columns("StateCode").Visible = False*/
	LOCAL oView
	oView := oCascadeTree:View()
		oView:ColumnAutoResize := .T.
		oView:Columns:Item("CountryCode"):Visible := .F.
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oColumn
	LOCAL oItems
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:SetProperty("ScrollPartVisible",0/*exVScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",1/*exHScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",2/*exScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:ScrollWidth := 4
		oCascadeTree:SetProperty("Background",276/*exVSBack*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oCascadeTree:SetProperty("Background",260/*exVSThumb*/,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oCascadeTree:ScrollHeight := 4
		oCascadeTree:SetProperty("Background",404/*exHSBack*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",388/*exHSThumb*/,oCascadeTree:Background(260/*exVSThumb*/))
		oCascadeTree:SetProperty("Background",511/*exScrollSizeGrip*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:SetProperty("Background",142/*exCSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",141/*exHSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",170/*exSplitBarSize*/,AutomationTranslateColor( GraMakeRGBColor  ( { 2,0,0 } )  , .F. ))
		oCascadeTree:EndUpdate()
		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:DefaultView():Columns:Item("CountryName"):SortOrder := 1/*SortAscending*/
		oCascadeTree:DefaultView():NextView():Columns:Item("StateName"):SortOrder := 1/*SortAscending*/
		oView := oCascadeTree:DefaultView():NextView():NextView()
			oView:ColumnAutoResize := .F.
			oColumn := oView:Columns:Item("Name")
				oColumn:SortOrder := 1/*SortAscending*/
				oColumn:Width := 128
			oItems := oView:Items()
				oItems:SetProperty("SelectItem",oItems:FindItem("Anchorage","Name"),.T.)
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
34
How can I access the next/prev/parent/child view

PROCEDURE OnCreateView(oCascadeTree,View)
	/*Columns("StateCode").Visible = False*/
	LOCAL oView
	oView := oCascadeTree:View()
		oView:ColumnAutoResize := .T.
		oView:Columns:Item("CountryCode"):Visible := .F.
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oColumn
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 2/*exSplitEqualCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "RO\CJ"
		oCascadeTree:DefaultView():Columns:Item("CountryName"):SortOrder := 1/*SortAscending*/
		oCascadeTree:DefaultView():NextView():Columns:Item("StateName"):SortOrder := 1/*SortAscending*/
		oView := oCascadeTree:DefaultView():NextView():NextView()
			oView:BeginUpdate()
			oView:ColumnAutoResize := .F.
			oColumn := oView:Columns:Item("Name")
				oColumn:Width := 128
				oColumn:SortOrder := 1/*SortAscending*/
			oView:SingleSort := .F.
			oView:AllowGroupBy := .T.
			oView:Columns:Item("Status"):SortOrder := 2/*SortDescending*/
			oView:TreeColumnIndex := oView:Columns:Item("Name"):Index()
			oView:EndUpdate()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
33
Predefined Keywords of ShowContextMenu property

PROCEDURE OnCreateView(oCascadeTree,View)
	/*Columns("StateCode").Visible = False*/
	LOCAL oView
	oView := oCascadeTree:View()
		oView:ColumnAutoResize := .T.
		oView:Columns:Item("CountryCode"):Visible := .F.
	oCascadeTree:StatusBarLabel := Transform(oCascadeTree:FormatABC("`<b>` + ( value replace `\\` with ` </b><font ;6><off 4>` )",oCascadeTree:Name()),"")
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

PROCEDURE OnViewEndChanging(oCascadeTree,Operation)
	oCascadeTree:StatusBarLabel := Transform(oCascadeTree:FormatABC("`<b>` + ( value replace `\\` with ` </b><font ;6><off 4>` )",oCascadeTree:Name()),"")
	oCascadeTree:ExecuteContextMenu := 0
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/
		oCascadeTree:ViewEndChanging := {|Operation| OnViewEndChanging(oCascadeTree,Operation)} /*Occurs once the user is about to change the view.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:AllowSplitView := 1/*exAllowOneSplitView*/
		oCascadeTree:FitCascadeColumns := 3
		oCascadeTree:Mode := 2/*exSplitEqualCascadeMode*/
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarHeight := 24
		oCascadeTree:SetProperty("ScrollPartVisible",0/*exVScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",1/*exHScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:SetProperty("ScrollPartVisible",2/*exScroll*/,65536/*exExtentThumbPart*/,.T.)
		oCascadeTree:ScrollWidth := 4
		oCascadeTree:SetProperty("Background",276/*exVSBack*/,AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))
		oCascadeTree:SetProperty("Background",260/*exVSThumb*/,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oCascadeTree:ScrollHeight := 4
		oCascadeTree:SetProperty("Background",404/*exHSBack*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",388/*exHSThumb*/,oCascadeTree:Background(260/*exVSThumb*/))
		oCascadeTree:SetProperty("Background",511/*exScrollSizeGrip*/,oCascadeTree:Background(276/*exVSBack*/))
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:SetProperty("Background",142/*exCSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",141/*exHSplitBar*/,oCascadeTree:Background(18/*exSplitBar*/))
		oCascadeTree:SetProperty("Background",170/*exSplitBarSize*/,AutomationTranslateColor( GraMakeRGBColor  ( { 2,0,0 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:ShowContextMenu := "`vlevels=` + vlevels + `,vlevel=` + vlevel + `,hlevels=` + hlevels + `,hlevel=` + hlevel + `,view=` + view "
		oCascadeTree:SplitViewHeight := "256"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
32
How can I display the identifiers of the control's context menu (debug)

PROCEDURE OnCreateView(oCascadeTree,View)
	/*Columns("StateCode").Visible = False*/
	LOCAL oView
	oView := oCascadeTree:View()
		oView:ColumnAutoResize := .T.
		oView:Columns:Item("CountryCode"):Visible := .F.
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

PROCEDURE OnViewEndChanging(oCascadeTree,Operation)
	DevOut( Transform(oCascadeTree:ExecuteContextMenu(),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/
		oCascadeTree:ViewEndChanging := {|Operation| OnViewEndChanging(oCascadeTree,Operation)} /*Occurs once the user is about to change the view.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:ShowContextMenu := "[debug]Popup(Item 1[id=1001],Item 2[id=1002],Item 3[id=1003]),[sep],Exit[def][id=1000]"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
31
ShowContextMenu usage

PROCEDURE OnCreateView(oCascadeTree,View)
	/*Columns("StateCode").Visible = False*/
	LOCAL oView
	oView := oCascadeTree:View()
		oView:ColumnAutoResize := .T.
		oView:Columns:Item("CountryCode"):Visible := .F.
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

PROCEDURE OnViewEndChanging(oCascadeTree,Operation)
	DevOut( Transform(oCascadeTree:ExecuteContextMenu(),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/
		oCascadeTree:ViewEndChanging := {|Operation| OnViewEndChanging(oCascadeTree,Operation)} /*Occurs once the user is about to change the view.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:ShowContextMenu := "Popup(Item 1[id=1001],Item 2[id=1002],Item 3[id=1003]),[sep],Exit[def][id=1000]"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
30
How can I resize automatically all views, when the control is resized

PROCEDURE OnCreateView(oCascadeTree,View)
	/*Columns("StateCode").Visible = False*/
	LOCAL oView
	oView := oCascadeTree:View()
		oView:ColumnAutoResize := .T.
		oView:Columns:Item("CountryCode"):Visible := .F.
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 515/*exAutoFitOnResizeClient+exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
29
How can I hide some columns

PROCEDURE OnCreateView(oCascadeTree,View)
	/*Columns("StateCode").Visible = False*/
	LOCAL oView
	oView := oCascadeTree:View()
		oView:ColumnAutoResize := .T.
		oView:Columns:Item("CountryCode"):Visible := .F.
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
28
Is it possible to disable resizing the cascade columns

PROCEDURE OnCreateView(oCascadeTree,View)
	oCascadeTree:View():ColumnAutoResize := .T.
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:Mode := 771/*exAutoFitOnResizeClient+exDisableResizeCascadeColumns+exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
27
SplitFixCascadeMode Mode

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
26
FixCascadeMode Mode

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DefColumnWidth := 96
		oCascadeTree:Mode := 0/*exFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
25
SplitEqualCascadeMode Mode

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:Mode := 2/*exSplitEqualCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
24
Default Mode

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:SetProperty("Background",18/*exSplitBar*/,AutomationTranslateColor( GraMakeRGBColor  ( { 196,196,196 } )  , .F. ))
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
23
SingleCascadeMode ( single-view )

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 1/*exSingleCascadeMode*/
		oView := oCascadeTree:DefaultView()
			oView:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Cities Where CountryCode = 'RO' "
			oView:AllowGroupBy := .T.
			oView:SortBarVisible := .T.
			oView:Columns:Item("StateCode"):SortOrder := 1/*SortAscending*/
			oView:Name := "Name"
		oCascadeTree:Name := "Isaccea"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
22
How can I display the current selection, as a path

PROCEDURE OnCreateView(oCascadeTree,View)
	oCascadeTree:StatusBarLabel := oCascadeTree:Name()
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

PROCEDURE OnViewEndChanging(oCascadeTree,Operation)
	oCascadeTree:StatusBarLabel := oCascadeTree:Name()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/
		oCascadeTree:ViewEndChanging := {|Operation| OnViewEndChanging(oCascadeTree,Operation)} /*Occurs once the user is about to change the view.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
21
How can I add multiple-views to the control

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 3/*exSplitFixCascadeMode*/
		oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		oCascadeTree:Select := "US\AK"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
20
I wish I select items based on names, rather than keys. Is that possible

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL label
	oCascadeTree:View():ColumnAutoResize := .F.
	label := oCascadeTree:FormatABC("`<b>Select = </b>` + value",oCascadeTree:Select())
	label := oCascadeTree:FormatABC("A + `<br>` + `<b>Name = </b>` + B replace `|` with ` `",label,oCascadeTree:Name())
	oCascadeTree:StatusBarLabel := Transform(label,"")
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

PROCEDURE OnViewEndChanging(oCascadeTree,Operation)
	LOCAL label
	label := oCascadeTree:FormatABC("`<b>Select = </b>` + value",oCascadeTree:Select())
	label := oCascadeTree:FormatABC("A + `<br>` + `<b>Name = </b>` + B replace `|` with ` `",label,oCascadeTree:Name())
	oCascadeTree:StatusBarLabel := Transform(label,"")
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL dm1,dm2,dm3,ds

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/
		oCascadeTree:ViewEndChanging := {|Operation| OnViewEndChanging(oCascadeTree,Operation)} /*Occurs once the user is about to change the view.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 2/*exSplitEqualCascadeMode*/
		oCascadeTree:StatusBarVisible := 18/*exStatusBarWordWrap+exStatusBarAnchorTop*/
		ds := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb"
		dm1 := "Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName"
		ds := oCascadeTree:FormatABC("A + `;` + B",ds,dm1)
		dm2 := "Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name"
		ds := oCascadeTree:FormatABC("A + ` >>> ` + B",ds,dm2)
		dm3 := "Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		ds := oCascadeTree:FormatABC("A + ` >>> ` + B",ds,dm3)
		oCascadeTree:DataSource := ds
		oCascadeTree:Name := "Romania\Cluj\Baciu*"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
19
I've noticed that I can't select multiple items. How can I do that

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oView
	LOCAL bColumnAutoResize,label
	bColumnAutoResize := oCascadeTree:FormatABC("not(A = `City`)",oCascadeTree:View:Tag())
	oView := oCascadeTree:View()
		oView:SingleSel := .F.
		oView:ColumnAutoResize := .F.
	label := oCascadeTree:FormatABC("`<b>Select = </b>` + value",oCascadeTree:Select())
	label := oCascadeTree:FormatABC("A + `<br>` + `<b>Name = </b>` + B replace `|` with ` `",label,oCascadeTree:Name())
	oCascadeTree:StatusBarLabel := Transform(label,"")
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

PROCEDURE OnViewEndChanging(oCascadeTree,Operation)
	LOCAL label
	label := oCascadeTree:FormatABC("`<b>Select = </b>` + value",oCascadeTree:Select())
	label := oCascadeTree:FormatABC("A + `<br>` + `<b>Name = </b>` + B replace `|` with ` `",label,oCascadeTree:Name())
	oCascadeTree:StatusBarLabel := Transform(label,"")
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL dm1,dm2,dm3,ds

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/
		oCascadeTree:ViewEndChanging := {|Operation| OnViewEndChanging(oCascadeTree,Operation)} /*Occurs once the user is about to change the view.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 2/*exSplitEqualCascadeMode*/
		oCascadeTree:StatusBarVisible := 18/*exStatusBarWordWrap+exStatusBarAnchorTop*/
		oCascadeTree:StatusBarHeight := 48
		ds := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb"
		dm1 := "Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName"
		ds := oCascadeTree:FormatABC("A + `;` + B",ds,dm1)
		dm2 := "Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name"
		ds := oCascadeTree:FormatABC("A + ` >>> ` + B",ds,dm2)
		dm3 := "Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"
		ds := oCascadeTree:FormatABC("A + ` >>> ` + B",ds,dm3)
		oCascadeTree:DataSource := ds
		oCascadeTree:Select := "RO\CJ|D*"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
18
How do I programmatically selects a path/item

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL bColumnAutoResize
	bColumnAutoResize := oCascadeTree:FormatABC("not(A = `City`)",oCascadeTree:View:Tag())
	oCascadeTree:View():ColumnAutoResize := .F.
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

PROCEDURE OnViewEndChanging(oCascadeTree,Operation)
	oCascadeTree:StatusBarLabel := oCascadeTree:Select()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL dm1,dm2,dm3,ds

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/
		oCascadeTree:ViewEndChanging := {|Operation| OnViewEndChanging(oCascadeTree,Operation)} /*Occurs once the user is about to change the view.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 2/*exSplitEqualCascadeMode*/
		oCascadeTree:StatusBarVisible := 1/*exStatusBarAnchorBottom*/
		ds := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb"
		dm1 := "Member=Select * FROM Countries;Key=CountryCode;Tag=Country"
		ds := oCascadeTree:FormatABC("A + `;` + B",ds,dm1)
		dm2 := "Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City"
		ds := oCascadeTree:FormatABC("A + ` >>> ` + B",ds,dm2)
		dm3 := "Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City"
		ds := oCascadeTree:FormatABC("A + ` >>> ` + B",ds,dm3)
		oCascadeTree:DataSource := ds
		oCascadeTree:Select := "RO\CJ"
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
17
DataSource/DataMember/Key/Tag

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oView
	LOCAL bColumnAutoResize,nWidth
	oCascadeTree:StatusBarLabel := Transform(oCascadeTree:FormatABC("value replace `data source` with `<b><fgcolor=808080>Source</fgcolor></b>` replace `Source` with `<b><fgcolor=808080>Source</fgcolor></b>` replace `Member` with `<b><fgcolor=808080>Member</fgcolor></b>` replace `Key` with `<b><fgcolor=808080>Key</fgcolor></b>` replace `Tag` with `<b><fgcolor=808080>Tag</fgcolor></b>` replace `;` with `;<br>`",oCascadeTree:View:DataSource()),"")
	bColumnAutoResize := oCascadeTree:FormatABC("not(A = `City`)",oCascadeTree:View:Tag())
	nWidth := oCascadeTree:FormatABC("A = `City` ? B : C",oCascadeTree:View:Tag(),oCascadeTree:View:WidthToFit(),oCascadeTree:View:Width())
	oView := oCascadeTree:View()
		oView:ColumnAutoResize := .F.
		oView:Width := nWidth
RETURN

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL dm1,dm2,dm3,ds

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarHeight := 58
		oCascadeTree:StatusBarVisible := 18/*exStatusBarWordWrap+exStatusBarAnchorTop*/
		ds := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb"
		dm1 := "Member=Select * FROM Countries;Key=CountryCode;Tag=Country"
		ds := oCascadeTree:FormatABC("A + `;` + B",ds,dm1)
		dm2 := "Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City"
		ds := oCascadeTree:FormatABC("A + ` >>> ` + B",ds,dm2)
		dm3 := "Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City"
		ds := oCascadeTree:FormatABC("A + ` >>> ` + B",ds,dm3)
		oCascadeTree:DataSource := ds
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
16
DataSource (view, data source, data member, ACCDB)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oView
	LOCAL dm,ds

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<b>DataSource</b> could " + CHR(34) + "Data Source=...;Data Member=..." + CHR(34) + " or " + CHR(34) + "Source=...;Member=..." + CHR(34) + " "
		oCascadeTree:DefColumnWidth := 336
		ds := "Data Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb"
		dm := "Data Member=Select * FROM Countries"
		oView := oCascadeTree:DefaultView()
			oView:DataSource := oCascadeTree:FormatABC("A + `;` + B",ds,dm)
			oView:ColumnAutoResize := .T.
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
15
DataSource (view, data source, data member, MDB)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oView
	LOCAL dm,ds

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<b>DataSource</b> could " + CHR(34) + "Data Source=...;Data Member=..." + CHR(34) + " or " + CHR(34) + "Source=...;Member=..." + CHR(34) + " "
		oCascadeTree:DefColumnWidth := 336
		ds := "Data Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.mdb"
		dm := "Data Member=Select * FROM Countries"
		oView := oCascadeTree:DefaultView()
			oView:DataSource := oCascadeTree:FormatABC("A + `;` + B",ds,dm)
			oView:ColumnAutoResize := .T.
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
14
DataSource (view, ADODB, ACCDB)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oView
	LOCAL ado

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<b>DataSource</b> could be string (Source/Member), ADO or DAO objects"
		oCascadeTree:DefColumnWidth := 336
		ado := CreateObject("ADODB.Recordset")
			ado:Open("Countries","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oView := oCascadeTree:DefaultView()
			oView:DataSource := ado
			oView:ColumnAutoResize := .T.
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
13
DataSource (view, ADODB, MDB)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oView
	LOCAL ado

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<b>DataSource</b> could be string (Source/Member), ADO or DAO objects"
		oCascadeTree:DefColumnWidth := 336
		ado := CreateObject("ADODB.Recordset")
			ado:Open("Countries","Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.mdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oView := oCascadeTree:DefaultView()
			oView:DataSource := ado
			oView:ColumnAutoResize := .T.
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
12
DataSource (control, data source, data member, ACCDB)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL dm,ds

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<b>DataSource</b> could " + CHR(34) + "Data Source=...;Data Member=..." + CHR(34) + " or " + CHR(34) + "Source=...;Member=..." + CHR(34) + " "
		oCascadeTree:DefColumnWidth := 336
		ds := "Data Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb"
		dm := "Data Member=Select * FROM Countries"
		oCascadeTree:DataSource := oCascadeTree:FormatABC("A + `;` + B",ds,dm)
		oCascadeTree:View():ColumnAutoResize := .T.
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
11
DataSource (control, data source, data member, MDB)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL dm,ds

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<b>DataSource</b> could " + CHR(34) + "Data Source=...;Data Member=..." + CHR(34) + " or " + CHR(34) + "Source=...;Member=..." + CHR(34) + " "
		oCascadeTree:DefColumnWidth := 336
		ds := "Data Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.mdb"
		dm := "Data Member=Select * FROM Countries"
		oCascadeTree:DataSource := oCascadeTree:FormatABC("A + `;` + B",ds,dm)
		oCascadeTree:View():ColumnAutoResize := .T.
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
10
DataSource (control, ADODB, ACCDB)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL ado

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<b>DataSource</b> could be string (Source/Member), ADO or DAO objects"
		oCascadeTree:DefColumnWidth := 336
		ado := CreateObject("ADODB.Recordset")
			ado:Open("Countries","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oCascadeTree:DataSource := ado
		oCascadeTree:View():ColumnAutoResize := .T.
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
9
DataSource (control, ADODB, MDB)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL ado

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<b>DataSource</b> could be string (Source/Member), ADO or DAO objects"
		oCascadeTree:DefColumnWidth := 336
		ado := CreateObject("ADODB.Recordset")
			ado:Open("Countries","Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.mdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oCascadeTree:DataSource := ado
		oCascadeTree:View():ColumnAutoResize := .T.
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
8
DataSource (view, XMLDOMDocument)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oView
	LOCAL xml

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<b>DataSource</b> could be a XML file name, a URL, an IStream, an IXMLDOMDocument"
		oCascadeTree:DefColumnWidth := 336
		oView := oCascadeTree:DefaultView()
			xml := CreateObject("MSXML.DOMDocument")
				xml:load("C:\Program Files\Exontrol\ExCascadeTree\Sample\Testing.xml")
			oView:DataSource := xml
			oView:ColumnAutoResize := .T.
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
7
DataSource (view, XML, file)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<b>DataSource</b> could be a XML file name, a URL, an IStream, an IXMLDOMDocument"
		oCascadeTree:DefColumnWidth := 336
		oView := oCascadeTree:DefaultView()
			oView:DataSource := "http://www.exontrol.net/testing.xml"
			oView:ColumnAutoResize := .T.
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
6
DataSource (control, XMLDOMDocument)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL xml

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<b>DataSource</b> could be a XML file name, a URL, an IStream, an IXMLDOMDocument"
		oCascadeTree:DefColumnWidth := 336
		xml := CreateObject("MSXML.DOMDocument")
			xml:load("C:\Program Files\Exontrol\ExCascadeTree\Sample\Testing.xml")
		oCascadeTree:DataSource := xml
		oCascadeTree:View():ColumnAutoResize := .T.
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
5
DataSource (control, XML, file)

PROCEDURE OnError(oCascadeTree,Error,Description)
	DevOut( "Error" )
	DevOut( Transform(Description,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:Error := {|Error,Description| OnError(oCascadeTree,Error,Description)} /*An internal error occurs.*/

		oCascadeTree:BeginUpdate()
		oCascadeTree:StatusBarVisible := 2/*exStatusBarAnchorTop*/
		oCascadeTree:StatusBarLabel := "<b>DataSource</b> could be a XML file name, a URL, an IStream, an IXMLDOMDocument"
		oCascadeTree:DefColumnWidth := 336
		oCascadeTree:DataSource := "http://www.exontrol.net/testing.xml"
		oCascadeTree:View():ColumnAutoResize := .T.
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
4
How can I get the selected items (sample 1)

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oItems
	LOCAL oView
	LOCAL k
	oView := oCascadeTree:View()
		k := oView:ParentView:Value()
		oView:BeginUpdate()
		oView:ColumnAutoResize := .T.
		oView:Key := -1
		oView:Columns():Add(Transform(k,""))
		oItems := oView:Items()
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 1`",k))
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 2`",k))
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 3`",k))
		oView:EndUpdate()
RETURN

PROCEDURE OnViewEndChanging(oCascadeTree,Operation)
	LOCAL oItems
	DevOut( "End" )
	DevOut( Transform(Operation,"") )
	oItems := oCascadeTree:View():Items()
		DevOut( "FocusItem" )
		DevOut( oItems:CellCaption(oItems:FocusItem(),0) )
		DevOut( "SelectedItem" )
		DevOut( oItems:CellCaption(oItems:SelectedItem(0),0) )
RETURN

PROCEDURE OnViewStartChanging(oCascadeTree,Operation)
	DevOut( "Start" )
	DevOut( Transform(Operation,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oItems
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/
		oCascadeTree:ViewEndChanging := {|Operation| OnViewEndChanging(oCascadeTree,Operation)} /*Occurs once the user is about to change the view.*/
		oCascadeTree:ViewStartChanging := {|Operation| OnViewStartChanging(oCascadeTree,Operation)} /*Occurs once the user is about to change the view.*/

		oCascadeTree:BeginUpdate()
		oView := oCascadeTree:View()
			oView:BeginUpdate()
			oView:ColumnAutoResize := .T.
			oView:Columns():Add("Default")
			oView:Key := 0
			oView:LinesAtRoot := -1/*exLinesAtRoot*/
			oItems := oView:Items()
				oItems:AddItem("Item A")
				oItems:SetProperty("SelectItem",oItems:AddItem("Item B"),.T.)
				oItems:AddItem("Item C")
			oView:EndUpdate()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
3
Can I use this control as a simple tree

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oItems
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:BeginUpdate()
		oCascadeTree:Mode := 1/*exSingleCascadeMode*/
		oView := oCascadeTree:View()
			oView:BeginUpdate()
			oView:ColumnAutoResize := .T.
			oView:Columns():Add("Default")
			oView:Key := -1
			oView:LinesAtRoot := -1/*exLinesAtRoot*/
			oItems := oView:Items()
				oItems:AddItem("Item A")
				oItems:InsertItem(oItems:AddItem("Item B"),,"Child")
				oItems:AddItem("Item C")
			oView:EndUpdate()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
2
How can I use this control

PROCEDURE OnCreateView(oCascadeTree,View)
	LOCAL oItems
	LOCAL oView
	LOCAL k
	oView := oCascadeTree:View()
		k := oView:ParentView:Value()
		oView:BeginUpdate()
		oView:ColumnAutoResize := .T.
		oView:Columns():Add(Transform(k,""))
		oItems := oView:Items()
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 1`",k))
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 2`",k))
			oItems:AddItem(oCascadeTree:FormatABC("A + `-> Sub-Item 3`",k))
		oView:EndUpdate()
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree
	LOCAL oItems
	LOCAL oView

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:CreateView := {|View| OnCreateView(oCascadeTree,View)} /*A view has been created.*/

		oCascadeTree:BeginUpdate()
		oView := oCascadeTree:View()
			oView:BeginUpdate()
			oView:ColumnAutoResize := .T.
			oView:Columns():Add("Default")
			oView:Key := 0
			oItems := oView:Items()
				oItems:AddItem("Item A")
				oItems:SetProperty("SelectItem",oItems:AddItem("Item B"),.T.)
				oItems:AddItem("Item C")
			oView:EndUpdate()
		oCascadeTree:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1
How do I change the control's background color
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oCascadeTree

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oCascadeTree := XbpActiveXControl():new( oForm:drawingArea )
	oCascadeTree:CLSID  := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/
	oCascadeTree:create(,, {10,60},{610,370} )

		oCascadeTree:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 240,240,240 } )  , .F. ))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN