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

/*begin event HostEvent(long  EventID) - Notifies the application once the host fires an event.*/
/*
	any h,key
	oG2Host = ole_1.Object
	h = oG2Host.HostEventParam(0)
	key = oG2Host.HostEventParam(1)
	MessageBox("Information",string( String(oG2Host.HostEventParam(-2)) ))
	MessageBox("Information",string( "Start:" ))
	MessageBox("Information",string( String(oG2Host.Host.Items.ItemBar(h,key,1)) ))
	MessageBox("Information",string( String(oG2Host.HostEventParam(-2)) ))
	MessageBox("Information",string( "End:" ))
	MessageBox("Information",string( String(oG2Host.Host.Items.ItemBar(h,key,2)) ))
*/
/*end event HostEvent*/

OleObject oG2Host,var_Chart,var_Items

oG2Host = ole_1.Object
var_Chart = oG2Host.Host.Chart
	var_Chart.PaneWidth(false,128)
	var_Chart.FirstVisibleDate = 2019-03-30
var_Items = oG2Host.Host.Items
	var_Items.AddBar(var_Items.AddItem("Task"),"Task",2019-04-01,2019-04-14)

49
How do I get the bar/task from the cursor
/*begin event HostEvent(long  EventID) - Notifies the application once the host fires an event.*/
/*
	OleObject var_Chart,var_G2antt
	any b,i
	oG2Host = ole_1.Object
	MessageBox("Information",string( "Event:" ))
	MessageBox("Information",string( String(oG2Host.HostEventParam(-2)) ))
	var_G2antt = oG2Host.Host
		i = var_G2antt.ItemFromPoint(-1,-1,c,h)
		MessageBox("Information",string( "Cell:" ))
		MessageBox("Information",string( var_G2antt.Items.CellCaption(i,c) ))
		var_Chart = var_G2antt.Chart
			b = var_Chart.BarFromPoint(-1,1)
			MessageBox("Information",string( "Bar:" ))
			MessageBox("Information",string( String(oG2Host.Host.Items.ItemBar(i,b,0)) ))
*/
/*end event HostEvent*/

OleObject oG2Host

oG2Host = ole_1.Object

48
How do I get the cell from the cursor

/*begin event HostEvent(long  EventID) - Notifies the application once the host fires an event.*/
/*
	OleObject var_G2antt
	any i
	oG2Host = ole_1.Object
	MessageBox("Information",string( "Event:" ))
	MessageBox("Information",string( String(oG2Host.HostEventParam(-2)) ))
	var_G2antt = oG2Host.Host
		i = var_G2antt.ItemFromPoint(-1,-1,c,h)
		MessageBox("Information",string( "Cell:" ))
		MessageBox("Information",string( var_G2antt.Items.CellCaption(i,c) ))
*/
/*end event HostEvent*/

OleObject oG2Host

oG2Host = ole_1.Object

47
How can I highlights cells based on its value

OleObject oG2Host,var_Column,var_Column1,var_ConditionalFormats,var_G2antt

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataField(12,"Color")
oG2Host.DataField(13,"TaskName")
var_G2antt = oG2Host.Host
	var_G2antt.BeginUpdate()
	var_G2antt.BackColorAlternate = RGB(0,0,0)
	var_Column = var_G2antt.Columns.Item("Title")
		var_Column.Def(4,15790320)
		var_Column.Width = var_Column.AutoWidth
	var_ConditionalFormats = var_G2antt.ConditionalFormats
		var_ConditionalFormats.Add("lower(%4) contains `manager`").Bold = true
		var_ConditionalFormats.Add("%3").BackColor = RGB(240,240,240)
	var_G2antt.Items.ExpandItem(0,true)
	var_Column1 = var_G2antt.Columns.Item("EmployeeID")
		var_Column1.Width = var_Column1.AutoWidth
	var_G2antt.EndUpdate()

46
How do I programatically hide a column

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataField(12,"Color")
oG2Host.DataField(13,"TaskName")
oG2Host.Host.Columns.Item("LastName").Visible = false

45
Is it possible to get the information from the control when we click on the bar/item

/*begin event HostEvent(long  EventID) - Notifies the application once the host fires an event.*/
/*
	OleObject var_G2antt
	any b,i
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(oG2Host.HostEventParam(-2)) ))
	var_G2antt = oG2Host.Host
		i = var_G2antt.ItemFromPoint(-1,-1,c,hit)
		MessageBox("Information",string( "cell's value from cursor: " ))
		MessageBox("Information",string( String(var_G2antt.Items.CellValue(i,c)) ))
		MessageBox("Information",string( "cell's value on col 1: " ))
		MessageBox("Information",string( String(var_G2antt.Items.CellValue(i,1)) ))
		b = var_G2antt.Chart.BarFromPoint(-1,-1)
		MessageBox("Information",string( "Bar:" ))
		MessageBox("Information",string( String(b) ))
		MessageBox("Information",string( "Bar Start:" ))
		MessageBox("Information",string( String(var_G2antt.Items.ItemBar(i,b,1)) ))
		MessageBox("Information",string( "Bar End:" ))
		MessageBox("Information",string( String(var_G2antt.Items.ItemBar(i,b,2)) ))
		MessageBox("Information",string( "Bar Caption:" ))
		MessageBox("Information",string( String(var_G2antt.Items.ItemBar(i,b,3)) ))
*/
/*end event HostEvent*/

OleObject oG2Host,var_Bar,var_Chart,var_G2antt

oG2Host = ole_1.Object
var_G2antt = oG2Host.Host
	var_G2antt.Debug = true
	var_Bar = var_G2antt.Chart.Bars.Item("Task")
		var_Bar.OverlaidType = 515 /*exOverlaidBarsStackAutoArrange | exOverlaidBarsStack*/
		var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataField(12,"Color")
oG2Host.DataField(13,"TaskName")
oG2Host.Host.Items.ExpandItem(0,true)
var_Chart = oG2Host.Host.Chart
	var_Chart.PaneWidth(false,128)
	var_Chart.ScrollTo(2017-05-27,1)

44
How do I get the bar from the cursor

/*begin event HostEvent(long  EventID) - Notifies the application once the host fires an event.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(oG2Host.HostEventParam(-2)) ))
	MessageBox("Information",string( String(oG2Host.Host.Chart.BarFromPoint(-1,-1)) ))
*/
/*end event HostEvent*/

OleObject oG2Host,var_Bar,var_Chart,var_G2antt

oG2Host = ole_1.Object
var_G2antt = oG2Host.Host
	var_G2antt.VisualAppearance.Add(1,"C:\Program Files\Exontrol\ExG2Host\Sample\EBN\Assorted\wbs-ass.ebn")
	var_Bar = var_G2antt.Chart.Bars.Item("Task")
		var_Bar.Height = 15
		var_Bar.Color = 33488896 /*0x1ff0000*/
		var_Bar.OverlaidType = 515 /*exOverlaidBarsStackAutoArrange | exOverlaidBarsStack*/
		var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataField(12,"Color")
oG2Host.DataField(13,"TaskName")
oG2Host.Host.Items.ExpandItem(0,true)
var_Chart = oG2Host.Host.Chart
	var_Chart.PaneWidth(false,128)
	var_Chart.ScrollTo(2017-05-27,1)

43
How do I add Start/End columns

/*begin event HostEvent(long  EventID) - Notifies the application once the host fires an event.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(oG2Host.HostEventParam(-2)) ))
*/
/*end event HostEvent*/

OleObject oG2Host,var_Chart,var_Column,var_Column1,var_G2antt

oG2Host = ole_1.Object
oG2Host.HostReadOnly = 255 /*exHostReadWrite | exHostAllowAddEmptyItem*/
var_G2antt = oG2Host.Host
	var_G2antt.SingleSel = false
	var_G2antt.OnResizeControl = 1
	var_G2antt.ScrollBars = 2058 /*exVScrollEmptySpace | exDisableNoVertical*/
	var_Column = var_G2antt.Columns.Add("Start")
		var_Column.AllowSizing = false
		var_Column.Def(18,1)
		var_Column.Editor.EditType = 7
	var_Column1 = var_G2antt.Columns.Add("End")
		var_Column1.AllowSizing = false
		var_Column1.Def(18,2)
		var_Column1.Editor.EditType = 7
	var_G2antt.Items.AllowCellValueToItemBar = true
	var_Chart = var_G2antt.Chart
		var_Chart.AllowCreateBar = 1
		var_Chart.PaneWidth(false,256)
		var_Chart.Bars.Item("Task").OverlaidType = 515 /*exOverlaidBarsStackAutoArrange | exOverlaidBarsStack*/

42
How do I hide the left/items/columns part of the control

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_Bar,var_Chart,var_G2antt

oG2Host = ole_1.Object
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.Pattern = 1
	var_Bar.Color = RGB(0,0,255)
	var_Bar.Def(19,50)
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataField(12,"Color")
oG2Host.DataField(13,"TaskName")
oG2Host.Host.Items.ExpandItem(0,true)
oG2Host.HostReadOnly = 255 /*exHostReadWrite | exHostAllowAddEmptyItem*/
var_G2antt = oG2Host.Host
	var_G2antt.OnResizeControl = 129 /*exDisableSplitter | exResizeChart*/
	var_Chart = var_G2antt.Chart
		var_Chart.ColumnsFormatLevel = "1"
		var_Chart.PaneWidth(false,0)
		var_Chart.ScrollTo(2017-05-27,1)

41
How do I hide the right/chart/tasks part of the control

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_Bar,var_Chart,var_G2antt

oG2Host = ole_1.Object
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.Pattern = 1
	var_Bar.Color = RGB(0,0,255)
	var_Bar.Def(19,50)
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataField(12,"Color")
oG2Host.DataField(13,"TaskName")
oG2Host.Host.Items.ExpandItem(0,true)
var_G2antt = oG2Host.Host
	var_Chart = var_G2antt.Chart
		var_Chart.PaneWidth(true,0)
		var_Chart.OverviewVisible = 0

40
How do hide the top/overview part of the control

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_Chart,var_G2antt

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataField(7,oG2Host.DataField(0))
oG2Host.DataField(9,"BirthDate")
oG2Host.DataField(10,"HireDate")
var_G2antt = oG2Host.Host
	var_Chart = var_G2antt.Chart
		var_Chart.OverviewVisible = 0
		var_Chart.PaneWidth(false,256)
		var_Chart.ScrollTo(1969-04-27,1)

39
How do I resize the panels

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_Bar,var_Chart,var_G2antt

oG2Host = ole_1.Object
var_G2antt = oG2Host.Host
	var_G2antt.VisualAppearance.Add(1,"C:\Program Files\Exontrol\ExG2Host\Sample\EBN\Assorted\wbs-ass.ebn")
	var_Bar = var_G2antt.Chart.Bars.Item("Task")
		var_Bar.Height = 15
		var_Bar.Color = 33488896 /*0x1ff0000*/
		var_Bar.OverlaidType = 515 /*exOverlaidBarsStackAutoArrange | exOverlaidBarsStack*/
		var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataField(12,"Color")
oG2Host.DataField(13,"TaskName")
oG2Host.Host.Items.ExpandItem(0,true)
var_Chart = oG2Host.Host.Chart
	var_Chart.PaneWidth(false,128)
	var_Chart.ScrollTo(2017-05-27,1)

38
How do I lock the first column

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_G2antt

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
var_G2antt = oG2Host.Host
	var_G2antt.CountLockedColumns = 1
	var_G2antt.BackColorLock = var_G2antt.BackColorAlternate

37
How do I specify a different color for the tasks ( EBN color )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_Bar,var_G2antt

oG2Host = ole_1.Object
var_G2antt = oG2Host.Host
	var_G2antt.VisualAppearance.Add(1,"C:\Program Files\Exontrol\ExG2Host\Sample\EBN\Assorted\wbs-ass.ebn")
	var_Bar = var_G2antt.Chart.Bars.Item("Task")
		var_Bar.Height = 15
		var_Bar.Color = 33488896 /*0x1ff0000*/
		var_Bar.OverlaidType = 515 /*exOverlaidBarsStackAutoArrange | exOverlaidBarsStack*/
		var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataField(12,"Color")
oG2Host.DataField(13,"TaskName")
oG2Host.Host.Items.ExpandItem(0,true)
oG2Host.Host.Chart.PaneWidth(false,256)
oG2Host.Host.Chart.ScrollTo(2017-05-27,1)

36
How do I specify a different color for the tasks ( solid color, transparent )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_Bar

oG2Host = ole_1.Object
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.Pattern = 1
	var_Bar.Color = RGB(0,0,255)
	var_Bar.Def(19,50)
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataField(12,"Color")
oG2Host.DataField(13,"TaskName")
oG2Host.Host.Items.ExpandItem(0,true)
oG2Host.Host.Chart.PaneWidth(false,256)
oG2Host.Host.Chart.ScrollTo(2017-05-27,1)

35
GroupBy

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_Bar,var_Column,var_G2antt

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataSource("Links",oG2Host.DataSource("Items"))
oG2Host.DataMember("Links","EmployeeLinks")
oG2Host.DataField(15,"Links")
oG2Host.DataField(16,"Start")
oG2Host.DataField(17,"End")
var_G2antt = oG2Host.Host
	var_G2antt.AllowGroupBy = true
	var_G2antt.SortBarVisible = true
	var_G2antt.BackColorSortBar = oG2Host.Host.BackColor
	var_G2antt.BackColorSortBarCaption = var_G2antt.BackColorSortBar
	var_G2antt.SortBarCaption = "<sha ;;0><fgcolor=FF0000>Drag a <b>column</b> header here to sort by that column."
	var_Bar = var_G2antt.Chart.Bars.Item("Task")
		var_Bar.OverlaidType = 515 /*exOverlaidBarsStackAutoArrange | exOverlaidBarsStack*/
		var_Bar.OverlaidGroup = "Task,Progress"
	var_G2antt.Items.ExpandItem(0,true)
	var_G2antt.CountLockedColumns = 1
	var_G2antt.BackColorLock = var_G2antt.BackColorAlternate
	var_Column = var_G2antt.Columns.Item("EmployeeID")
		var_Column.AllowGroupBy = false
		var_Column.Def(7,oG2Host.Host.BackColorAlternate)
	var_G2antt.Columns.Item("Title").SortOrder = 1
oG2Host.Host.Chart.ScrollTo(2017-05-27,1)

34
How can I hide a column
/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.Host.Columns.Item(0).Visible = false

33
Can row errors being highligted until the user correct them, not to clear them as soon a change occurs

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.HostDef(7,false)

32
No error is highligthed

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")

31
I've noticed that rows with errors are shown in red. Is it possible to change the colors

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.HostDef(6,0)
oG2Host.HostDef(5,16777215)

30
Is it possible to rename the (New) to something else

OleObject oG2Host,var_G2antt

oG2Host = ole_1.Object
oG2Host.HostDef(1,"*")
var_G2antt = oG2Host.Host
	var_G2antt.BeginUpdate()
	var_G2antt.Items.AddItem("A")
	var_G2antt.Items.AddItem("B")
	var_G2antt.EndUpdate()
oG2Host.Refresh()

29
How can I hide the (New) item (sample 2)

OleObject oG2Host,var_G2antt

oG2Host = ole_1.Object
oG2Host.HostReadOnly = 240 /*exHostAllowUpdate | exHostAllowDelete*/
var_G2antt = oG2Host.Host
	var_G2antt.BeginUpdate()
	var_G2antt.Items.AddItem("A")
	var_G2antt.Items.AddItem("B")
	var_G2antt.EndUpdate()

28
How can I hide the (New) item (sample 1)

OleObject oG2Host,var_G2antt

oG2Host = ole_1.Object
oG2Host.HostDef(1,"")
var_G2antt = oG2Host.Host
	var_G2antt.BeginUpdate()
	var_G2antt.Items.AddItem("A")
	var_G2antt.Items.AddItem("B")
	var_G2antt.EndUpdate()
oG2Host.Refresh()

27
Read-Only

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.HostReadOnly = 0

26
How can I prevent user create new /delete tasks ( only move or resize then )
/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_Bar

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataSource("Links",oG2Host.DataSource("Items"))
oG2Host.DataMember("Links","EmployeeLinks")
oG2Host.DataField(15,"Links")
oG2Host.DataField(16,"Start")
oG2Host.DataField(17,"End")
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 /*exOverlaidBarsStackAutoArrange | exOverlaidBarsStack*/
	var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.Host.Items.ExpandItem(0,true)
oG2Host.HostReadOnly = 128
oG2Host.Host.Chart.ScrollTo(2017-05-27,1)

25
How do I get the row/item/task/link from the cursor

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

/*begin event HostEvent(long  EventID) - Notifies the application once the host fires an event.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( oG2Host.HostContext.ToString ))
*/
/*end event HostEvent*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.HostReadOnly = 141 /*exHostAllowUpdate | exHostAllowAddNew*/

24
Disable Delete
/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.HostReadOnly = 141 /*exHostAllowUpdate | exHostAllowAddNew*/

23
Disable AddNew

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.HostReadOnly = 240 /*exHostAllowUpdate | exHostAllowDelete*/

22
ACCDB sample ( file )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_Bar

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataSource("Links",oG2Host.DataSource("Items"))
oG2Host.DataMember("Links","EmployeeLinks")
oG2Host.DataField(15,"Links")
oG2Host.DataField(16,"Start")
oG2Host.DataField(17,"End")
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 /*exOverlaidBarsStackAutoArrange | exOverlaidBarsStack*/
	var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.Host.Items.ExpandItem(0,true)
oG2Host.Host.Chart.ScrollTo(2017-05-27,1)

21
MDB sample ( file )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_Bar

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.mdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataSource("Links",oG2Host.DataSource("Items"))
oG2Host.DataMember("Links","EmployeeLinks")
oG2Host.DataField(15,"Links")
oG2Host.DataField(16,"Start")
oG2Host.DataField(17,"End")
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 /*exOverlaidBarsStackAutoArrange | exOverlaidBarsStack*/
	var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.Host.Items.ExpandItem(0,true)
oG2Host.Host.Chart.ScrollTo(2017-05-27,1)

20
DBF sample ( file )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.dbf")
oG2Host.DataField(0,"Items")

19
DAO sample ( object, DAO.DBEngine.120, multiple tasks, multiple tables )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,rsEmployees,rsLinks,rsTasks,var_Bar,var_Database,var_PrivDBEngine

oG2Host = ole_1.Object
var_PrivDBEngine = CREATE OLEObject
var_PrivDBEngine.ConnectToNewObject("DAO.DBEngine.120")
	var_Database = var_PrivDBEngine.OpenDatabase("C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
		rsEmployees = var_Database.OpenRecordset("Employees")
		rsTasks = var_Database.OpenRecordset("EmployeeDetails")
		rsLinks = var_Database.OpenRecordset("EmployeeLinks")
oG2Host.DataSource("Items",rsEmployees)
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataSource("Tasks",rsTasks)
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataSource("Links",rsLinks)
oG2Host.DataField(15,"Links")
oG2Host.DataField(16,"Start")
oG2Host.DataField(17,"End")
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 /*exOverlaidBarsStackAutoArrange | exOverlaidBarsStack*/
	var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.Host.Items.ExpandItem(0,true)
oG2Host.Host.Chart.ScrollTo(2017-05-27,1)

18
DAO sample ( file, multiple tasks, multiple tables )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_Bar

oG2Host = ole_1.Object
oG2Host.DataTechnology("Items","DAO.DBEngine.120;DAO.DBEngine.36")
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataTechnology("Tasks","DAO.DBEngine.120;DAO.DBEngine.36")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataTechnology("Links","DAO.DBEngine.120;DAO.DBEngine.36")
oG2Host.DataSource("Links",oG2Host.DataSource("Items"))
oG2Host.DataMember("Links","EmployeeLinks")
oG2Host.DataField(15,"Links")
oG2Host.DataField(16,"Start")
oG2Host.DataField(17,"End")
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 /*exOverlaidBarsStackAutoArrange | exOverlaidBarsStack*/
	var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.Host.Items.ExpandItem(0,true)
oG2Host.Host.Chart.ScrollTo(2017-05-27,1)

17
DAO sample ( object, DAO.DBEngine.120, single task, single table )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,rsEmployees,rsLinks,var_Database,var_PrivDBEngine

oG2Host = ole_1.Object
var_PrivDBEngine = CREATE OLEObject
var_PrivDBEngine.ConnectToNewObject("DAO.DBEngine.120")
	var_Database = var_PrivDBEngine.OpenDatabase("C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
		rsEmployees = var_Database.OpenRecordset("Employees")
		rsLinks = var_Database.OpenRecordset("EmployeeLinks")
oG2Host.DataSource("Items",rsEmployees)
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataField(7,oG2Host.DataField(0))
oG2Host.DataField(9,"BirthDate")
oG2Host.DataField(10,"HireDate")
oG2Host.DataSource("Links",rsLinks)
oG2Host.DataField(15,"Links")
oG2Host.DataField(16,"Start")
oG2Host.DataField(17,"End")

16
DAO sample ( file, single task, single table )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataTechnology("Items","DAO.DBEngine.120;DAO.DBEngine.36")
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataField(7,oG2Host.DataField(0))
oG2Host.DataField(9,"BirthDate")
oG2Host.DataField(10,"HireDate")
oG2Host.DataTechnology("Links","DAO.DBEngine.120;DAO.DBEngine.36")
oG2Host.DataSource("Links",oG2Host.DataSource("Items"))
oG2Host.DataMember("Links","EmployeeLinks")
oG2Host.DataField(15,"Links")
oG2Host.DataField(16,"Start")
oG2Host.DataField(17,"End")

15
DAO sample ( tree recordset )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataTechnology("Items","DAO.DBEngine.120;DAO.DBEngine.36")
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")

14
DAO sample ( flat recordset )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,rsEmployees,var_Database,var_PrivDBEngine

oG2Host = ole_1.Object
var_PrivDBEngine = CREATE OLEObject
var_PrivDBEngine.ConnectToNewObject("DAO.DBEngine.120")
	var_Database = var_PrivDBEngine.OpenDatabase("C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
		rsEmployees = var_Database.OpenRecordset("Employees")
oG2Host.DataSource("Items",rsEmployees)
oG2Host.DataField(0,"Items")

13
DAO sample ( flat )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataTechnology("Items","DAO.DBEngine.120;DAO.DBEngine.36")
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")

12
ADO sample ( object, ADODB.Recordset, multiple tasks )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,rsEmployees,rsLinks,rsTasks,var_Bar

oG2Host = ole_1.Object
rsEmployees = CREATE OLEObject
rsEmployees.ConnectToNewObject("ADODB.Recordset")
rsEmployees.Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
oG2Host.DataSource("Items",rsEmployees)
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
rsTasks = CREATE OLEObject
rsTasks.ConnectToNewObject("ADODB.Recordset")
rsTasks.Open("EmployeeDetails","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
oG2Host.DataSource("Tasks",rstasks)
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
rsLinks = CREATE OLEObject
rsLinks.ConnectToNewObject("ADODB.Recordset")
rsLinks.Open("EmployeeLinks","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
oG2Host.DataSource("Links",rsLinks)
oG2Host.DataField(15,"Links")
oG2Host.DataField(16,"Start")
oG2Host.DataField(17,"End")
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 /*exOverlaidBarsStackAutoArrange | exOverlaidBarsStack*/
	var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.Host.Items.ExpandItem(0,true)
oG2Host.Host.Chart.ScrollTo(2017-05-27,1)

11
ADO sample ( file, multiple tasks, multiple tables )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_Bar

oG2Host = ole_1.Object
oG2Host.DataTechnology("Items","ADODB.Recordset;ADOR.Recordset")
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataTechnology("Tasks","ADODB.Recordset;ADOR.Recordset")
oG2Host.DataSource("Tasks",oG2Host.DataSource("Items"))
oG2Host.DataMember("Tasks","EmployeeDetails")
oG2Host.DataField(7,"Tasks")
oG2Host.DataField(8,"EmployeeID")
oG2Host.DataField(9,"DateStart")
oG2Host.DataField(10,"DateEnd")
oG2Host.DataField(14,"TaskID")
oG2Host.DataTechnology("Links","ADODB.Recordset;ADOR.Recordset")
oG2Host.DataSource("Links",oG2Host.DataSource("Items"))
oG2Host.DataMember("Links","EmployeeLinks")
oG2Host.DataField(15,"Links")
oG2Host.DataField(16,"Start")
oG2Host.DataField(17,"End")
var_Bar = oG2Host.Host.Chart.Bars.Item("Task")
	var_Bar.OverlaidType = 515 /*exOverlaidBarsStackAutoArrange | exOverlaidBarsStack*/
	var_Bar.OverlaidGroup = "Task,Progress"
oG2Host.Host.Items.ExpandItem(0,true)
oG2Host.Host.Chart.ScrollTo(2017-05-27,1)

10
ADO sample ( object, ADODB.Recordset, single task, single table )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,rsEmployees,rsLinks

oG2Host = ole_1.Object
rsEmployees = CREATE OLEObject
rsEmployees.ConnectToNewObject("ADODB.Recordset")
rsEmployees.Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
oG2Host.DataSource("Items",rsEmployees)
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataField(7,oG2Host.DataField(0))
oG2Host.DataField(9,"BirthDate")
oG2Host.DataField(10,"HireDate")
rsLinks = CREATE OLEObject
rsLinks.ConnectToNewObject("ADODB.Recordset")
rsLinks.Open("EmployeeLinks","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
oG2Host.DataSource("Links",rsLinks)
oG2Host.DataField(15,"Links")
oG2Host.DataField(16,"Start")
oG2Host.DataField(17,"End")

9
ADO sample ( file, single task, single table )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataTechnology("Items","ADODB.Recordset;ADOR.Recordset")
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")
oG2Host.DataField(7,oG2Host.DataField(0))
oG2Host.DataField(9,"BirthDate")
oG2Host.DataField(10,"HireDate")
oG2Host.DataTechnology("Links","ADODB.Recordset;ADOR.Recordset")
oG2Host.DataSource("Links",oG2Host.DataSource("Items"))
oG2Host.DataMember("Links","EmployeeLinks")
oG2Host.DataField(15,"Links")
oG2Host.DataField(16,"Start")
oG2Host.DataField(17,"End")

8
ADO sample ( tree recordset )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataTechnology("Items","ADODB.Recordset;ADOR.Recordset")
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")
oG2Host.DataField(1,"EmployeeID")
oG2Host.DataField(2,"ReportsTo")

7
ADO sample ( flat recordset )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,rsEmployees

oG2Host = ole_1.Object
rsEmployees = CREATE OLEObject
rsEmployees.ConnectToNewObject("ADODB.Recordset")
rsEmployees.Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb",3,3)
oG2Host.DataSource("Items",rsEmployees)
oG2Host.DataField(0,"Items")

6
ADO sample ( flat table )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host

oG2Host = ole_1.Object
oG2Host.DataTechnology("Items","ADODB.Recordset;ADOR.Recordset")
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.accdb")
oG2Host.DataMember("Items","Employees")
oG2Host.DataField(0,"Items")

5
XML sample ( object, MSXML.DOMDocument )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_G2antt,xml

oG2Host = ole_1.Object
xml = CREATE OLEObject
xml.ConnectToNewObject("MSXML.DOMDocument")
xml.async = false
xml.load("C:\Program Files\Exontrol\ExG2Host\Sample\sample.xml")
oG2Host.DataSource("Items",xml)
oG2Host.DataField(0,"Items")
var_G2antt = oG2Host.Host
	var_G2antt.LinesAtRoot = -1
	var_G2antt.SingleSel = false
	var_G2antt.AutoDrag = 3

4
XML sample ( file tree )

/*begin event Error(long  Error,string  Description) - Fired when an internal error occurs.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(Error) ))
	MessageBox("Information",string( String(Description) ))
*/
/*end event Error*/

OleObject oG2Host,var_G2antt

oG2Host = ole_1.Object
oG2Host.DataTechnology("Items","MSXML.DOMDocument")
oG2Host.DataSource("Items","C:\Program Files\Exontrol\ExG2Host\Sample\sample.xml")
oG2Host.DataField(0,"Items")
var_G2antt = oG2Host.Host
	var_G2antt.LinesAtRoot = -1
	var_G2antt.SingleSel = false
	var_G2antt.AutoDrag = 3

3
How can I let user create new items/bars when clicking the empty area of the control
/*begin event HostEvent(long  EventID) - Notifies the application once the host fires an event.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(oG2Host.HostEventParam(-2)) ))
*/
/*end event HostEvent*/

OleObject oG2Host,var_Chart,var_G2antt

oG2Host = ole_1.Object
oG2Host.HostReadOnly = 255 /*exHostReadWrite | exHostAllowAddEmptyItem*/
var_G2antt = oG2Host.Host
	var_G2antt.ScrollBars = 2058 /*exVScrollEmptySpace | exDisableNoVertical*/
	var_Chart = var_G2antt.Chart
		var_Chart.PaneWidth(false,128)
		var_Chart.AllowCreateBar = 1

2
How do I handle events of the host

/*begin event HostEvent(long  EventID) - Notifies the application once the host fires an event.*/
/*
	oG2Host = ole_1.Object
	MessageBox("Information",string( String(oG2Host.HostEventParam(-2)) ))
*/
/*end event HostEvent*/

OleObject oG2Host,var_G2antt

oG2Host = ole_1.Object
var_G2antt = oG2Host.Host
	var_G2antt.BeginUpdate()
	var_G2antt.Columns.Add("new column")
	var_G2antt.EndUpdate()

1
How can I get the version of the host/exg2antt control

OleObject oG2Host

oG2Host = ole_1.Object
MessageBox("Information",string( oG2Host.Version ))
MessageBox("Information",string( "Host" ))
MessageBox("Information",string( oG2Host.Host.Version ))