50
How do I get the start/end of the bar once the BarResize/BarResizing event occurs

' HostEvent event - Notifies the application once the host fires an event.
Private Sub AxG2Host1_HostEvent(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_HostEventEvent) Handles AxG2Host1.HostEvent
	Dim h,key
	With AxG2Host1
		h = .get_HostEventParam(0)
		key = .get_HostEventParam(1)
		Debug.Print( .get_HostEventParam(-2) )
		Debug.Print( "Start:" )
		Debug.Print( .Host.Items.ItemBar(h,key,1) )
		Debug.Print( .get_HostEventParam(-2) )
		Debug.Print( "End:" )
		Debug.Print( .Host.Items.ItemBar(h,key,2) )
	End With
End Sub

With AxG2Host1
	With .Host.Chart
		.PaneWidth(False) = 128
		.FirstVisibleDate = #3/30/2019#
	End With
	With .Host.Items
		.AddBar(.AddItem("Task"),"Task",#4/1/2019#,#4/14/2019#)
	End With
End With
49
How do I get the bar/task from the cursor
' HostEvent event - Notifies the application once the host fires an event.
Private Sub AxG2Host1_HostEvent(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_HostEventEvent) Handles AxG2Host1.HostEvent
	Dim b,c,h,i
	With AxG2Host1
		Debug.Print( "Event:" )
		Debug.Print( .get_HostEventParam(-2) )
		With .Host
			i = .ItemFromPoint(-1,-1,c,h)
			Debug.Print( "Cell:" )
			Debug.Print( .Items.CellCaption(i,c) )
			With .Chart
				b = .BarFromPoint(-1,1)
				Debug.Print( "Bar:" )
				Debug.Print( AxG2Host1.Host.Items.ItemBar(i,b,0) )
			End With
		End With
	End With
End Sub


48
How do I get the cell from the cursor

' HostEvent event - Notifies the application once the host fires an event.
Private Sub AxG2Host1_HostEvent(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_HostEventEvent) Handles AxG2Host1.HostEvent
	Dim c,h,i
	With AxG2Host1
		Debug.Print( "Event:" )
		Debug.Print( .get_HostEventParam(-2) )
		With .Host
			i = .ItemFromPoint(-1,-1,c,h)
			Debug.Print( "Cell:" )
			Debug.Print( .Items.CellCaption(i,c) )
		End With
	End With
End Sub


47
How can I highlights cells based on its value

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,"Color")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,"TaskName")
	With .Host
		.BeginUpdate()
		.BackColorAlternate = RGB(0,0,0)
		With .Columns.Item("Title")
			.Def(4) = 15790320
			.Width = .AutoWidth
		End With
		With .ConditionalFormats
			.Add("lower(%4) contains `manager`").Bold = True
			.Add("%3").BackColor = RGB(240,240,240)
		End With
		.Items.ExpandItem(0) = True
		With .Columns.Item("EmployeeID")
			.Width = .AutoWidth
		End With
		.EndUpdate()
	End With
End With
46
How do I programatically hide a column

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,"Color")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,"TaskName")
	.Host.Columns.Item("LastName").Visible = False
End With
45
Is it possible to get the information from the control when we click on the bar/item

' HostEvent event - Notifies the application once the host fires an event.
Private Sub AxG2Host1_HostEvent(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_HostEventEvent) Handles AxG2Host1.HostEvent
	Dim b,c,hit,i
	With AxG2Host1
		Debug.Print( .get_HostEventParam(-2) )
		With .Host
			i = .ItemFromPoint(-1,-1,c,hit)
			Debug.Print( "cell's value from cursor: " )
			Debug.Print( .Items.CellValue(i,c) )
			Debug.Print( "cell's value on col 1: " )
			Debug.Print( .Items.CellValue(i,1) )
			b = .Chart.BarFromPoint(-1,-1)
			Debug.Print( "Bar:" )
			Debug.Print( b )
			Debug.Print( "Bar Start:" )
			Debug.Print( .Items.ItemBar(i,b,1) )
			Debug.Print( "Bar End:" )
			Debug.Print( .Items.ItemBar(i,b,2) )
			Debug.Print( "Bar Caption:" )
			Debug.Print( .Items.ItemBar(i,b,3) )
		End With
	End With
End Sub

With AxG2Host1
	With .Host
		.Debug = True
		With .Chart.Bars.Item("Task")
			.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
			.OverlaidGroup = "Task,Progress"
		End With
	End With
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,"Color")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,"TaskName")
	.Host.Items.ExpandItem(0) = True
	With .Host.Chart
		.PaneWidth(False) = 128
		.ScrollTo(#5/27/2017#,1)
	End With
End With
44
How do I get the bar from the cursor

' HostEvent event - Notifies the application once the host fires an event.
Private Sub AxG2Host1_HostEvent(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_HostEventEvent) Handles AxG2Host1.HostEvent
	With AxG2Host1
		Debug.Print( .get_HostEventParam(-2) )
		Debug.Print( .Host.Chart.BarFromPoint(-1,-1) )
	End With
End Sub

With AxG2Host1
	With .Host
		.VisualAppearance.Add(1,"C:\Program Files\Exontrol\ExG2Host\Sample\EBN\Assorted\wbs-ass.ebn")
		With .Chart.Bars.Item("Task")
			.Height = 15
			.Color = &H1ff0000
			.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
			.OverlaidGroup = "Task,Progress"
		End With
	End With
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,"Color")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,"TaskName")
	.Host.Items.ExpandItem(0) = True
	With .Host.Chart
		.PaneWidth(False) = 128
		.ScrollTo(#5/27/2017#,1)
	End With
End With
43
How do I add Start/End columns

' HostEvent event - Notifies the application once the host fires an event.
Private Sub AxG2Host1_HostEvent(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_HostEventEvent) Handles AxG2Host1.HostEvent
	With AxG2Host1
		Debug.Print( .get_HostEventParam(-2) )
	End With
End Sub

With AxG2Host1
	.HostReadOnly = EXG2HOSTLib.HostReadOnlyEnum.exHostReadWrite Or EXG2HOSTLib.HostReadOnlyEnum.exHostAllowAddEmptyItem
	With .Host
		.SingleSel = False
		.OnResizeControl = 1
		.ScrollBars = EXG2ANTTLib.ScrollBarsEnum.exVScrollEmptySpace Or EXG2ANTTLib.ScrollBarsEnum.exDisableNoVertical
		With .Columns.Add("Start")
			.AllowSizing = False
			.Def(18) = 1
			.Editor.EditType = 7
		End With
		With .Columns.Add("End")
			.AllowSizing = False
			.Def(18) = 2
			.Editor.EditType = 7
		End With
		.Items.AllowCellValueToItemBar = True
		With .Chart
			.AllowCreateBar = 1
			.PaneWidth(False) = 256
			.Bars.Item("Task").OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
		End With
	End With
End With
42
How do I hide the left/items/columns part of the control

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	With .Host.Chart.Bars.Item("Task")
		.Pattern = 1
		.Color = RGB(0,0,255)
		.Def(19) = 50
	End With
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,"Color")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,"TaskName")
	.Host.Items.ExpandItem(0) = True
	.HostReadOnly = EXG2HOSTLib.HostReadOnlyEnum.exHostReadWrite Or EXG2HOSTLib.HostReadOnlyEnum.exHostAllowAddEmptyItem
	With .Host
		.OnResizeControl = EXG2ANTTLib.OnResizeControlEnum.exDisableSplitter Or EXG2ANTTLib.OnResizeControlEnum.exResizeChart
		With .Chart
			.ColumnsFormatLevel = "1"
			.PaneWidth(False) = 0
			.ScrollTo(#5/27/2017#,1)
		End With
	End With
End With
41
How do I hide the right/chart/tasks part of the control

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	With .Host.Chart.Bars.Item("Task")
		.Pattern = 1
		.Color = RGB(0,0,255)
		.Def(19) = 50
	End With
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,"Color")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,"TaskName")
	.Host.Items.ExpandItem(0) = True
	With .Host
		With .Chart
			.PaneWidth(True) = 0
			.OverviewVisible = 0
		End With
	End With
End With
40
How do hide the top/overview part of the control

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,.get_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource))
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"BirthDate")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"HireDate")
	With .Host
		With .Chart
			.OverviewVisible = 0
			.PaneWidth(False) = 256
			.ScrollTo(#4/27/1969#,1)
		End With
	End With
End With
39
How do I resize the panels

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	With .Host
		.VisualAppearance.Add(1,"C:\Program Files\Exontrol\ExG2Host\Sample\EBN\Assorted\wbs-ass.ebn")
		With .Chart.Bars.Item("Task")
			.Height = 15
			.Color = &H1ff0000
			.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
			.OverlaidGroup = "Task,Progress"
		End With
	End With
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,"Color")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,"TaskName")
	.Host.Items.ExpandItem(0) = True
	With .Host.Chart
		.PaneWidth(False) = 128
		.ScrollTo(#5/27/2017#,1)
	End With
End With
38
How do I lock the first column

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	With .Host
		.CountLockedColumns = 1
		.BackColorLock = .BackColorAlternate
	End With
End With
37
How do I specify a different color for the tasks ( EBN color )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	With .Host
		.VisualAppearance.Add(1,"C:\Program Files\Exontrol\ExG2Host\Sample\EBN\Assorted\wbs-ass.ebn")
		With .Chart.Bars.Item("Task")
			.Height = 15
			.Color = &H1ff0000
			.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
			.OverlaidGroup = "Task,Progress"
		End With
	End With
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,"Color")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,"TaskName")
	.Host.Items.ExpandItem(0) = True
	.Host.Chart.PaneWidth(False) = 256
	.Host.Chart.ScrollTo(#5/27/2017#,1)
End With
36
How do I specify a different color for the tasks ( solid color, transparent )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	With .Host.Chart.Bars.Item("Task")
		.Pattern = 1
		.Color = RGB(0,0,255)
		.Def(19) = 50
	End With
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksColor,"Color")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksCaption,"TaskName")
	.Host.Items.ExpandItem(0) = True
	.Host.Chart.PaneWidth(False) = 256
	.Host.Chart.ScrollTo(#5/27/2017#,1)
End With
35
GroupBy

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataSource("Links",.get_DataSource("Items"))
	.set_DataMember("Links","EmployeeLinks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,"Links")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,"Start")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,"End")
	With .Host
		.AllowGroupBy = True
		.SortBarVisible = True
		.BackColorSortBar = AxG2Host1.Host.BackColor
		.BackColorSortBarCaption = .BackColorSortBar
		.SortBarCaption = "<sha ;;0><fgcolor=FF0000>Drag a <b>column</b> header here to sort by that column."
		With .Chart.Bars.Item("Task")
			.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
			.OverlaidGroup = "Task,Progress"
		End With
		.Items.ExpandItem(0) = True
		.CountLockedColumns = 1
		.BackColorLock = .BackColorAlternate
		With .Columns.Item("EmployeeID")
			.AllowGroupBy = False
			.Def(7) = AxG2Host1.Host.BackColorAlternate
		End With
		.Columns.Item("Title").SortOrder = 1
	End With
	.Host.Chart.ScrollTo(#5/27/2017#,1)
End With
34
How can I hide a column
' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.Host.Columns.Item(0).Visible = False
End With
33
Can row errors being highligted until the user correct them, not to clear them as soon a change occurs

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_HostDef(EXG2HOSTLib.DefHostPropertyEnum.exErrorClearOnChange,False)
End With
32
No error is highligthed

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
End With
31
I've noticed that rows with errors are shown in red. Is it possible to change the colors

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_HostDef(EXG2HOSTLib.DefHostPropertyEnum.exErrorBackColor,0)
	.set_HostDef(EXG2HOSTLib.DefHostPropertyEnum.exErrorForeColor,16777215)
End With
30
Is it possible to rename the (New) to something else

With AxG2Host1
	.set_HostDef(EXG2HOSTLib.DefHostPropertyEnum.exNew,"*")
	With .Host
		.BeginUpdate()
		.Items.AddItem("A")
		.Items.AddItem("B")
		.EndUpdate()
	End With
	.Refresh()
End With
29
How can I hide the (New) item (sample 2)

With AxG2Host1
	.HostReadOnly = EXG2HOSTLib.HostReadOnlyEnum.exHostAllowUpdate Or EXG2HOSTLib.HostReadOnlyEnum.exHostAllowDelete
	With .Host
		.BeginUpdate()
		.Items.AddItem("A")
		.Items.AddItem("B")
		.EndUpdate()
	End With
End With
28
How can I hide the (New) item (sample 1)

With AxG2Host1
	.set_HostDef(EXG2HOSTLib.DefHostPropertyEnum.exNew,"")
	With .Host
		.BeginUpdate()
		.Items.AddItem("A")
		.Items.AddItem("B")
		.EndUpdate()
	End With
	.Refresh()
End With
27
Read-Only

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.HostReadOnly = EXG2HOSTLib.HostReadOnlyEnum.exHostReadOnly
End With
26
How can I prevent user create new /delete tasks ( only move or resize then )
' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataSource("Links",.get_DataSource("Items"))
	.set_DataMember("Links","EmployeeLinks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,"Links")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,"Start")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,"End")
	With .Host.Chart.Bars.Item("Task")
		.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
		.OverlaidGroup = "Task,Progress"
	End With
	.Host.Items.ExpandItem(0) = True
	.HostReadOnly = EXG2HOSTLib.HostReadOnlyEnum.exHostAllowUpdate
	.Host.Chart.ScrollTo(#5/27/2017#,1)
End With
25
How do I get the row/item/task/link from the cursor

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

' HostEvent event - Notifies the application once the host fires an event.
Private Sub AxG2Host1_HostEvent(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_HostEventEvent) Handles AxG2Host1.HostEvent
	With AxG2Host1
		Debug.Print( .HostContext.ToString )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.HostReadOnly = EXG2HOSTLib.HostReadOnlyEnum.exHostAllowUpdate Or EXG2HOSTLib.HostReadOnlyEnum.exHostAllowAddNew
End With
24
Disable Delete
' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.HostReadOnly = EXG2HOSTLib.HostReadOnlyEnum.exHostAllowUpdate Or EXG2HOSTLib.HostReadOnlyEnum.exHostAllowAddNew
End With
23
Disable AddNew

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.HostReadOnly = EXG2HOSTLib.HostReadOnlyEnum.exHostAllowUpdate Or EXG2HOSTLib.HostReadOnlyEnum.exHostAllowDelete
End With
22
ACCDB sample ( file )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataSource("Links",.get_DataSource("Items"))
	.set_DataMember("Links","EmployeeLinks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,"Links")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,"Start")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,"End")
	With .Host.Chart.Bars.Item("Task")
		.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
		.OverlaidGroup = "Task,Progress"
	End With
	.Host.Items.ExpandItem(0) = True
	.Host.Chart.ScrollTo(#5/27/2017#,1)
End With
21
MDB sample ( file )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.mdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataSource("Links",.get_DataSource("Items"))
	.set_DataMember("Links","EmployeeLinks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,"Links")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,"Start")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,"End")
	With .Host.Chart.Bars.Item("Task")
		.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
		.OverlaidGroup = "Task,Progress"
	End With
	.Host.Items.ExpandItem(0) = True
	.Host.Chart.ScrollTo(#5/27/2017#,1)
End With
20
DBF sample ( file )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.dbf")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
End With
19
DAO sample ( object, DAO.DBEngine.120, multiple tasks, multiple tables )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

Dim rsEmployees,rsLinks,rsTasks
With AxG2Host1
	With CreateObject("DAO.DBEngine.120")
		With .OpenDatabase("C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
			rsEmployees = .OpenRecordset("Employees")
			rsTasks = .OpenRecordset("EmployeeDetails")
			rsLinks = .OpenRecordset("EmployeeLinks")
		End With
	End With
	.set_DataSource("Items",rsEmployees)
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataSource("Tasks",rsTasks)
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataSource("Links",rsLinks)
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,"Links")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,"Start")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,"End")
	With .Host.Chart.Bars.Item("Task")
		.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
		.OverlaidGroup = "Task,Progress"
	End With
	.Host.Items.ExpandItem(0) = True
	.Host.Chart.ScrollTo(#5/27/2017#,1)
End With
18
DAO sample ( file, multiple tasks, multiple tables )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataTechnology("Items","DAO.DBEngine.120;DAO.DBEngine.36")
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataTechnology("Tasks","DAO.DBEngine.120;DAO.DBEngine.36")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataTechnology("Links","DAO.DBEngine.120;DAO.DBEngine.36")
	.set_DataSource("Links",.get_DataSource("Items"))
	.set_DataMember("Links","EmployeeLinks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,"Links")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,"Start")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,"End")
	With .Host.Chart.Bars.Item("Task")
		.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
		.OverlaidGroup = "Task,Progress"
	End With
	.Host.Items.ExpandItem(0) = True
	.Host.Chart.ScrollTo(#5/27/2017#,1)
End With
17
DAO sample ( object, DAO.DBEngine.120, single task, single table )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

Dim rsEmployees,rsLinks
With AxG2Host1
	With CreateObject("DAO.DBEngine.120")
		With .OpenDatabase("C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
			rsEmployees = .OpenRecordset("Employees")
			rsLinks = .OpenRecordset("EmployeeLinks")
		End With
	End With
	.set_DataSource("Items",rsEmployees)
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,.get_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource))
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"BirthDate")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"HireDate")
	.set_DataSource("Links",rsLinks)
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,"Links")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,"Start")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,"End")
End With
16
DAO sample ( file, single task, single table )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataTechnology("Items","DAO.DBEngine.120;DAO.DBEngine.36")
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,.get_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource))
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"BirthDate")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"HireDate")
	.set_DataTechnology("Links","DAO.DBEngine.120;DAO.DBEngine.36")
	.set_DataSource("Links",.get_DataSource("Items"))
	.set_DataMember("Links","EmployeeLinks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,"Links")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,"Start")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,"End")
End With
15
DAO sample ( tree recordset )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataTechnology("Items","DAO.DBEngine.120;DAO.DBEngine.36")
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
End With
14
DAO sample ( flat recordset )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

Dim rsEmployees
With AxG2Host1
	With CreateObject("DAO.DBEngine.120")
		With .OpenDatabase("C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
			rsEmployees = .OpenRecordset("Employees")
		End With
	End With
	.set_DataSource("Items",rsEmployees)
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
End With
13
DAO sample ( flat )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataTechnology("Items","DAO.DBEngine.120;DAO.DBEngine.36")
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
End With
12
ADO sample ( object, ADODB.Recordset, multiple tasks )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

Dim rsEmployees,rsLinks,rsTasks,rstasks
With AxG2Host1
	rsEmployees = CreateObject("ADODB.Recordset")
	rsEmployees.Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
	.set_DataSource("Items",rsEmployees)
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	rsTasks = CreateObject("ADODB.Recordset")
	rsTasks.Open("EmployeeDetails","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
	.set_DataSource("Tasks",rstasks)
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	rsLinks = CreateObject("ADODB.Recordset")
	rsLinks.Open("EmployeeLinks","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
	.set_DataSource("Links",rsLinks)
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,"Links")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,"Start")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,"End")
	With .Host.Chart.Bars.Item("Task")
		.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
		.OverlaidGroup = "Task,Progress"
	End With
	.Host.Items.ExpandItem(0) = True
	.Host.Chart.ScrollTo(#5/27/2017#,1)
End With
11
ADO sample ( file, multiple tasks, multiple tables )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataTechnology("Items","ADODB.Recordset;ADOR.Recordset")
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataTechnology("Tasks","ADODB.Recordset;ADOR.Recordset")
	.set_DataSource("Tasks",.get_DataSource("Items"))
	.set_DataMember("Tasks","EmployeeDetails")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,"Tasks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksItemID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"DateStart")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"DateEnd")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksID,"TaskID")
	.set_DataTechnology("Links","ADODB.Recordset;ADOR.Recordset")
	.set_DataSource("Links",.get_DataSource("Items"))
	.set_DataMember("Links","EmployeeLinks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,"Links")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,"Start")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,"End")
	With .Host.Chart.Bars.Item("Task")
		.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
		.OverlaidGroup = "Task,Progress"
	End With
	.Host.Items.ExpandItem(0) = True
	.Host.Chart.ScrollTo(#5/27/2017#,1)
End With
10
ADO sample ( object, ADODB.Recordset, single task, single table )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

Dim rsEmployees,rsLinks
With AxG2Host1
	rsEmployees = CreateObject("ADODB.Recordset")
	rsEmployees.Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
	.set_DataSource("Items",rsEmployees)
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,.get_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource))
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"BirthDate")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"HireDate")
	rsLinks = CreateObject("ADODB.Recordset")
	rsLinks.Open("EmployeeLinks","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
	.set_DataSource("Links",rsLinks)
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,"Links")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,"Start")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,"End")
End With
9
ADO sample ( file, single task, single table )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataTechnology("Items","ADODB.Recordset;ADOR.Recordset")
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksDataSource,.get_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource))
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksStart,"BirthDate")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exTasksEnd,"HireDate")
	.set_DataTechnology("Links","ADODB.Recordset;ADOR.Recordset")
	.set_DataSource("Links",.get_DataSource("Items"))
	.set_DataMember("Links","EmployeeLinks")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksDataSource,"Links")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksStart,"Start")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exLinksEnd,"End")
End With
8
ADO sample ( tree recordset )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataTechnology("Items","ADODB.Recordset;ADOR.Recordset")
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsID,"EmployeeID")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsParentID,"ReportsTo")
End With
7
ADO sample ( flat recordset )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

Dim rsEmployees
With AxG2Host1
	rsEmployees = CreateObject("ADODB.Recordset")
	rsEmployees.Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
	.set_DataSource("Items",rsEmployees)
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
End With
6
ADO sample ( flat table )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataTechnology("Items","ADODB.Recordset;ADOR.Recordset")
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
	.set_DataMember("Items","Employees")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
End With
5
XML sample ( object, MSXML.DOMDocument )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

Dim xml
With AxG2Host1
	xml = CreateObject("MSXML.DOMDocument")
	xml.async = False
	xml.load("C:\Program Files\Exontrol\ExG2Host\Sample\sample.xml")
	.set_DataSource("Items",xml)
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	With .Host
		.LinesAtRoot = -1
		.SingleSel = False
		.AutoDrag = 3
	End With
End With
4
XML sample ( file tree )

' Error event - Fired when an internal error occurs.
Private Sub AxG2Host1_Error(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_ErrorEvent) Handles AxG2Host1.Error
	With AxG2Host1
		Debug.Print( e.error )
		Debug.Print( e.description )
	End With
End Sub

With AxG2Host1
	.set_DataTechnology("Items","MSXML.DOMDocument")
	.set_DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.xml")
	.set_DataField(EXG2HOSTLib.HostObjectFieldEnum.exItemsDataSource,"Items")
	With .Host
		.LinesAtRoot = -1
		.SingleSel = False
		.AutoDrag = 3
	End With
End With
3
How can I let user create new items/bars when clicking the empty area of the control
' HostEvent event - Notifies the application once the host fires an event.
Private Sub AxG2Host1_HostEvent(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_HostEventEvent) Handles AxG2Host1.HostEvent
	With AxG2Host1
		Debug.Print( .get_HostEventParam(-2) )
	End With
End Sub

With AxG2Host1
	.HostReadOnly = EXG2HOSTLib.HostReadOnlyEnum.exHostReadWrite Or EXG2HOSTLib.HostReadOnlyEnum.exHostAllowAddEmptyItem
	With .Host
		.ScrollBars = EXG2ANTTLib.ScrollBarsEnum.exVScrollEmptySpace Or EXG2ANTTLib.ScrollBarsEnum.exDisableNoVertical
		With .Chart
			.PaneWidth(False) = 128
			.AllowCreateBar = 1
		End With
	End With
End With
2
How do I handle events of the host

' HostEvent event - Notifies the application once the host fires an event.
Private Sub AxG2Host1_HostEvent(ByVal sender As System.Object, ByVal e As AxEXG2HOSTLib._IG2HostEvents_HostEventEvent) Handles AxG2Host1.HostEvent
	With AxG2Host1
		Debug.Print( .get_HostEventParam(-2) )
	End With
End Sub

With AxG2Host1
	With .Host
		.BeginUpdate()
		.Columns.Add("new column")
		.EndUpdate()
	End With
End With
1
How can I get the version of the host/exg2antt control

With AxG2Host1
	Debug.Print( .Version )
	Debug.Print( "Host" )
	Debug.Print( .Host.Version )
End With