2403
|
Locks the first visible column on the left and the last visible column on the right

' AddItem event - Occurs after a new Item has been inserted to Items collection.
Private Sub AxG2antt1_AddItem(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_AddItemEvent) Handles AxG2antt1.AddItem
With AxG2antt1
With .Items
.AddBar(e.item,"Task",.CellValue(e.item,1),.CellValue(e.item,2))
End With
End With
End Sub
Dim rs
With AxG2antt1
.BeginUpdate()
With .Chart
.FirstVisibleDate = #8/8/1994#
.LevelCount = 2
End With
.ColumnAutoResize = False
.BackColorLock = RGB(192,192,192)
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesSolid
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exVLines
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
rs = CreateObject("ADOR.Recordset")
With rs
.Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.mdb",3,3)
End With
.DataSource = rs
.CountLockedColumns = 17
.EndUpdate()
End With
|
2402
|
Lock the column on the right

' AddItem event - Occurs after a new Item has been inserted to Items collection.
Private Sub AxG2antt1_AddItem(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_AddItemEvent) Handles AxG2antt1.AddItem
With AxG2antt1
With .Items
.AddBar(e.item,"Task",.CellValue(e.item,1),.CellValue(e.item,2))
End With
End With
End Sub
Dim rs
With AxG2antt1
.BeginUpdate()
With .Chart
.FirstVisibleDate = #8/8/1994#
.LevelCount = 2
End With
.ColumnAutoResize = False
.BackColorLock = RGB(192,192,192)
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesSolid
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exVLines
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
rs = CreateObject("ADOR.Recordset")
With rs
.Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.mdb",3,3)
End With
.DataSource = rs
.CountLockedColumns = 16
.EndUpdate()
End With
|
2401
|
Lock the column on the left

' AddItem event - Occurs after a new Item has been inserted to Items collection.
Private Sub AxG2antt1_AddItem(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_AddItemEvent) Handles AxG2antt1.AddItem
With AxG2antt1
With .Items
.AddBar(e.item,"Task",.CellValue(e.item,1),.CellValue(e.item,2))
End With
End With
End Sub
Dim rs
With AxG2antt1
.BeginUpdate()
With .Chart
.FirstVisibleDate = #8/8/1994#
.LevelCount = 2
End With
.ColumnAutoResize = False
.BackColorLock = RGB(192,192,192)
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesSolid
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exVLines
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
rs = CreateObject("ADOR.Recordset")
With rs
.Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.mdb",3,3)
End With
.DataSource = rs
.CountLockedColumns = 1
.EndUpdate()
End With
|
2400
|
Mask for Floating-Point Numbers (Emglish Style: . as Decimal, , as Grouping Separator)

With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exRowLines
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesSolid
.SelForeColor = .ForeColor
.SelBackColor = .BackColor
.ShowFocusRect = False
With .Columns.Add("Float(English-style)")
.SortType = EXG2ANTTLib.SortTypeEnum.SortNumeric
.FormatColumn = "value format `3`"
.HeaderAlignment = EXG2ANTTLib.AlignmentEnum.RightAlignment
.Alignment = EXG2ANTTLib.AlignmentEnum.RightAlignment
With .Editor
.EditType = EXG2ANTTLib.EditTypeEnum.MaskType
.Mask = "!999,999,990.000;;;float,right,negative,grouping=\,,decimal=."
End With
End With
With .Items
.AddItem(192278.12)
.AddItem(2829.7)
.AddItem(7391.55)
.AddItem(50812.23)
.AddItem(913.04)
.AddItem(127500.88)
.AddItem(62.19)
.AddItem(1)
End With
.EndUpdate()
End With
|
2399
|
Mask for Floating-Point Numbers (German Style: , as Decimal, . as Grouping Separator)

With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exRowLines
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesSolid
.SelForeColor = .ForeColor
.SelBackColor = .BackColor
.ShowFocusRect = False
With .Columns.Add("Float(German-style)")
.SortType = EXG2ANTTLib.SortTypeEnum.SortNumeric
.FormatColumn = "value format `3`"
.HeaderAlignment = EXG2ANTTLib.AlignmentEnum.RightAlignment
.Alignment = EXG2ANTTLib.AlignmentEnum.RightAlignment
With .Editor
.EditType = EXG2ANTTLib.EditTypeEnum.MaskType
.Mask = "!999.999.990,000;;;float,right,grouping=.,decimal=\,"
End With
End With
With .Items
.AddItem(192278.12)
.AddItem(2829.7)
.AddItem(7391.55)
.AddItem(50812.23)
.AddItem(913.04)
.AddItem(127500.88)
.AddItem(62.19)
.AddItem(1)
End With
.EndUpdate()
End With
|
2398
|
Update the item's lock state - pinning it to the top, bottom, or making it scrollable

With AxG2antt1
.BeginUpdate()
.Columns.Add("Column")
With .Items
.AddItem("un-locked item")
.LockItem(.AddItem("top-locked item")) = EXG2ANTTLib.LockItemEnum.exLockTop
.LockItem(.AddItem("bottom-locked item")) = EXG2ANTTLib.LockItemEnum.exLockBottom
End With
.EndUpdate()
End With
|
2397
|
Is it possible to extend the HotBackColor property to the chart section, so that an item is highlighted when the cursor hovers over it
With AxG2antt1
.BeginUpdate()
.Columns.Add("Def")
.HotBackColor = RGB(107,182,255)
.HotForeColor = RGB(255,255,255)
.set_Background(EXG2ANTTLib.BackgroundPartEnum.exChartCreateBar,65536)
With .Chart
.LevelCount = 2
.PaneWidth(False) = 128
.SelBackColor = AxG2antt1.SelBackColor
.HotBackColor = AxG2antt1.HotBackColor
.HotForeColor = AxG2antt1.HotForeColor
.AllowCreateBar = EXG2ANTTLib.CreateBarEnum.exCreateBarAuto
With .Bars.Item("Task")
.Color = RGB(0,0,0)
.Pattern = EXG2ANTTLib.PatternEnum.exPatternSolid
End With
End With
With .Items
.AddItem("Item A")
.AddItem("Item B")
.AddItem("Item C")
End With
.EndUpdate()
End With
|
2396
|
The Change event is called before changing the value. Is there any event such as Changed that is called after updating the cell's value
' Changed event - Occurs after the user has changed the content of a cell.
Private Sub AxG2antt1_Changed(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_ChangedEvent) Handles AxG2antt1.Changed
With AxG2antt1
Debug.Print( .Items.CellValue(e.item,e.colIndex) )
End With
End Sub
With AxG2antt1
.BeginUpdate()
.Chart.PaneWidth(True) = 0
.Columns.Add("Edit").Editor.EditType = EXG2ANTTLib.EditTypeEnum.EditType
.Items.AddItem("Item 1")
.Items.AddItem("Item 2")
.EndUpdate()
End With
|
2395
|
How can I reposition the +/- (expand/collapse) icon to show as "number, icon, text" (sample 2)
' AnchorClick event - Occurs when an anchor element is clicked.
Private Sub AxG2antt1_AnchorClick(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_AnchorClickEvent) Handles AxG2antt1.AnchorClick
Dim exp,i
With AxG2antt1
i = .FormatABC("int(value)",e.anchorID)
With .Items
i = .ItemByIndex(i)
exp = .ExpandItem(i)
.ExpandItem(i) = False
End With
End With
End Sub
Dim h,hRoot
With AxG2antt1
.BeginUpdate()
.set_HTMLPicture("expand","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYc7YYBY5vVBkiIYOhFLB0KZvMx0O5hORlABQM" & _
"JpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyxgjsRzEKv1TqtXrNbrtfsIAwgASAH" & _
"AGShQwGQzGABUGEzudAqgyWdSmWw2Fw+sABSHI4AGH1XAGAxGAwywlI6eRqjGi1YuaJJEIJUHBPYqSJYKQAwCBDKbBPbncBibrUKQjGLFQo+TBFfR5GaUAR/KbGICyRx" & _
"siCOQClgdJxGoMpkGycpdDqUZ0EoJQJHYVoWCSCA4kEbRlHKRwJiYcYCH0PBNB2JwYCaCRsGcE8LDyfZKg+U59EsAZMlQCgJkcEA9CsywkiKJwiFcIQwEEgI=")
.set_HTMLPicture("collapse","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYU7YQBCooJSAiIYOhFLB0KZvMx0O5hORlABQM" & _
"JpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyzyO13dGEAGYzWcqlWrFarlesA3AGc" & _
"SAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWISpVLiXT5MrxiJyJJEIJUHBPYqSXYOQAgBgAB6jJwufxxX7YYhdYhFCSsSwSC4uMLoQajNJ" & _
"AG8QgZAgSIqGMCwRBkAJDicGwuiMeoHGeaRFlAU5qDwQQ6A+CYnlgPQeisGJfl4AJYhsRISjQYwJHIcpmmALAtlMEpkE4YBREmEpPBAARdicSw8AES5fi+fI5g+PpcAA" & _
"UJKgyCYknaZRrssJIiicIhXCEMBBICA==")
.HeaderVisible = EXG2ANTTLib.HeaderVisibleEnum.exHeaderHidden
.HasLines = EXG2ANTTLib.HierarchyLineEnum.exNoLine
.HasButtons = EXG2ANTTLib.ExpandButtonEnum.exNoButtons
.Indent = 12
.DefaultItemHeight = 24
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exHLines
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesSolid
.GridLineColor = RGB(204,204,204)
.ShowFocusRect = False
.ExpandOnDblClick = False
.ExpandOnKeys = False
With .Columns
With .Add("Item")
.Def(EXG2ANTTLib.DefColumnEnum.exCellValueFormat) = 1
.FormatColumn = "(len(parent(1 index ``)) ? (`<b><fgcolor gray>` + (1 pos ``) + `. ` + `</fgcolor></b>` + `<a ` + (0 index ``) + `><img>` + (%CC" & _
"0 ? (not %CX0 ? `expand` : `collapse`) : ``) + `:16</img></a>`) : ``) + ` ` + value"
End With
End With
With .Items
hRoot = .AddItem("ACME Corporation")
.SelectableItem(hRoot) = False
.ExpandItem(hRoot) = True
h = .InsertItem(hRoot,Nothing,"Management")
.InsertItem(h,Nothing,"CEO - Alice Brown")
.InsertItem(h,Nothing,"COO - James Lee")
h = .InsertItem(hRoot,Nothing,"HR Department")
.InsertItem(h,Nothing,"Recruiter - Jane Smith")
.InsertItem(h,Nothing,"HR Assistant - Bob Green")
.ExpandItem(h) = True
h = .InsertItem(h,Nothing,"Engineering")
.InsertItem(h,Nothing,"Software Team")
h = .InsertItem(h,Nothing,"Lead Developer - Mark H.")
.InsertItem(h,Nothing,"Frontend Dev - Emily R.")
.InsertItem(h,Nothing,"Backend Dev - Tom W.")
.InsertItem(hRoot,Nothing,"QA Team")
End With
.EndUpdate()
End With
|
2394
|
How can I reposition the +/- (expand/collapse) icon to show as "number, icon, text" (sample 1)

' AnchorClick event - Occurs when an anchor element is clicked.
Private Sub AxG2antt1_AnchorClick(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_AnchorClickEvent) Handles AxG2antt1.AnchorClick
Dim exp,i
With AxG2antt1
i = .FormatABC("int(value)",e.anchorID)
With .Items
i = .ItemByIndex(i)
exp = .ExpandItem(i)
.ExpandItem(i) = False
End With
End With
End Sub
Dim h,hRoot
With AxG2antt1
.BeginUpdate()
.set_HTMLPicture("expand","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYc7YYBY5vVBkiIYOhFLB0KZvMx0O5hORlABQM" & _
"JpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyxgjsRzEKv1TqtXrNbrtfsIAwgASAH" & _
"AGShQwGQzGABUGEzudAqgyWdSmWw2Fw+sABSHI4AGH1XAGAxGAwywlI6eRqjGi1YuaJJEIJUHBPYqSJYKQAwCBDKbBPbncBibrUKQjGLFQo+TBFfR5GaUAR/KbGICyRx" & _
"siCOQClgdJxGoMpkGycpdDqUZ0EoJQJHYVoWCSCA4kEbRlHKRwJiYcYCH0PBNB2JwYCaCRsGcE8LDyfZKg+U59EsAZMlQCgJkcEA9CsywkiKJwiFcIQwEEgI=")
.set_HTMLPicture("collapse","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYU7YQBCooJSAiIYOhFLB0KZvMx0O5hORlABQM" & _
"JpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyzyO13dGEAGYzWcqlWrFarlesA3AGc" & _
"SAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWISpVLiXT5MrxiJyJJEIJUHBPYqSXYOQAgBgAB6jJwufxxX7YYhdYhFCSsSwSC4uMLoQajNJ" & _
"AG8QgZAgSIqGMCwRBkAJDicGwuiMeoHGeaRFlAU5qDwQQ6A+CYnlgPQeisGJfl4AJYhsRISjQYwJHIcpmmALAtlMEpkE4YBREmEpPBAARdicSw8AES5fi+fI5g+PpcAA" & _
"UJKgyCYknaZRrssJIiicIhXCEMBBICA==")
.HeaderVisible = EXG2ANTTLib.HeaderVisibleEnum.exHeaderHidden
.HasLines = EXG2ANTTLib.HierarchyLineEnum.exNoLine
.HasButtons = EXG2ANTTLib.ExpandButtonEnum.exNoButtons
.Indent = 12
.DefaultItemHeight = 24
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exHLines
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesSolid
.GridLineColor = RGB(204,204,204)
.ShowFocusRect = False
.ExpandOnDblClick = False
.ExpandOnKeys = False
With .Columns
With .Add("Item")
.Def(EXG2ANTTLib.DefColumnEnum.exCellValueFormat) = 1
.FormatColumn = "(len(parent(1 index ``)) ? (`<b><fgcolor gray>` + (1 pos ``) + `. ` + `</fgcolor></b>` + `<a ` + (0 index ``) + `><img>` + (%CC" & _
"0 ? (not %CX0 ? `expand` : `collapse`) : ``) + `:16</img></a>`) : ``) + ` ` + value"
End With
End With
With .Items
hRoot = .AddItem("ACME Corporation")
.SelectableItem(hRoot) = False
.ExpandItem(hRoot) = True
h = .InsertItem(hRoot,Nothing,"Management")
.InsertItem(h,Nothing,"CEO - Alice Brown")
.InsertItem(h,Nothing,"COO - James Lee")
h = .InsertItem(hRoot,Nothing,"HR Department")
.InsertItem(h,Nothing,"Recruiter - Jane Smith")
.InsertItem(h,Nothing,"HR Assistant - Bob Green")
.ExpandItem(h) = True
h = .InsertItem(h,Nothing,"Engineering")
.InsertItem(h,Nothing,"Software Team")
h = .InsertItem(h,Nothing,"Lead Developer - Mark H.")
.InsertItem(h,Nothing,"Frontend Dev - Emily R.")
.InsertItem(h,Nothing,"Backend Dev - Tom W.")
.InsertItem(hRoot,Nothing,"QA Team")
End With
.EndUpdate()
End With
|
2393
|
Expandable bullet list

' AnchorClick event - Occurs when an anchor element is clicked.
Private Sub AxG2antt1_AnchorClick(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_AnchorClickEvent) Handles AxG2antt1.AnchorClick
Dim exp,i
With AxG2antt1
i = .FormatABC("int(value)",e.anchorID)
With .Items
i = .ItemByIndex(i)
exp = .ExpandItem(i)
.ExpandItem(i) = False
End With
End With
End Sub
Dim h,hRoot
With AxG2antt1
.BeginUpdate()
.set_HTMLPicture("expand","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYM7YIBXCRNbtiIYOhFLB0KZvMx0O5hORlABQM" & _
"JpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyzZO13dGEAGYzWcqlWrFarlesA3AGc" & _
"SAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWNa6awbST7DBTiLyJJEIJUHBPUqSGJuYYwCAES5pBiQfyEX4QKAFH6QSihJQ/GZlET1FhIcg" & _
"GnUdoVHMmxajSIghlMKhsGiAAFggQ5dmKcRHEUEhbFAFQBgacABmAAJgAAcAJkAZgNjUcwDFecYcD8QoIDsGJjD6aYaGyHI7mqLRfgGfBcg+TYggkEhakQThtFsEpAE2" & _
"Xh7goSIJiSHp6haKgPGOXx3j+c5hiKLpri6JAPHWYJREuFJkBCYxcFeYS7ikJQzG0ZIVGKMBYGsVwXDWVQHjqfpjAoYpyE4Z5vH2YoHDkZwzkkUxHC8pwCgifIHBCdk4" & _
"GMLQVmcXJVhicxWi4IIUiKSQ1A8cBUj+eBEGCFQlFSIophiPRkFAWBLFALhwm+HhKjARpmgSGwNn4AIUCcZZUFEKoVmwywkiKJwiFcIQwEEgI")
.set_HTMLPicture("collapse","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYM7YIBXCRNbtiIYOhFLB0KZvMx0O5hORlABQM" & _
"JpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyzZO13dGEAGYzWcqlWrFarlesA3AGc" & _
"SAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWNa6awbST7DBTiLZJJEIJUHBPdpSGKOAQxCAzGhIBKfbAvUBsSIPbiVMhLTxJPK3banJB0N5" & _
"sA8VQRlmCRKjSCRaAIOgCiORISiWaI0DYLJPBYJBxB+LAqAMBRgAsIABjAAhYAOEB5kKDQ5kGZoaCaL5vH2KoEDCbpbDaWRrE8SopE+AA/DcMoZkgAgkhKERDlcdYEHA" & _
"JRzg4IpyCAKRyl6HZLGONwMEMb5clwWB3n2CZki6FoWC4cwQCbGYukKwhiAwOp3HIEJFGCNBGDyLArE8R56n4RUnlOShHGcXJdgcKQlCOSRdEcLw8DmAoInyexvFeMRG" & _
"G0DARmsbRZmsfRxleFZeHoD4eEKKRxGmPANgAC5xDAWpYHMW4uCGywkiKJwiFcIQwEEgI")
.HeaderVisible = EXG2ANTTLib.HeaderVisibleEnum.exHeaderHidden
.HasLines = EXG2ANTTLib.HierarchyLineEnum.exNoLine
.HasButtons = EXG2ANTTLib.ExpandButtonEnum.exNoButtons
.Indent = 12
.DefaultItemHeight = 24
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exHLines
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesSolid
.GridLineColor = RGB(204,204,204)
.ShowFocusRect = False
.ExpandOnDblClick = False
.ExpandOnKeys = False
With .Columns
With .Add("Item")
.Def(EXG2ANTTLib.DefColumnEnum.exCellValueFormat) = 1
.FormatColumn = "(len(parent(1 index ``)) ? (`<b><fgcolor gray>` + (1 pos ``) + `. ` + `</fgcolor></b>` + `<a ` + (0 index ``) + `><img>` + (%CC" & _
"0 ? (not %CX0 ? `expand` : `collapse`) : `collapse`) + `:16</img></a>`) : ``) + ` ` + value"
With .Editor
.EditType = EXG2ANTTLib.EditTypeEnum.EditType
.Option(EXG2ANTTLib.EditorOptionEnum.exEditorAdjustPos) = "32D 4D -4D -4D"
End With
End With
End With
With .Items
hRoot = .AddItem("ACME Corporation")
.SelectableItem(hRoot) = False
.ExpandItem(hRoot) = True
h = .InsertItem(hRoot,Nothing,"Management")
.InsertItem(h,Nothing,"CEO - Alice Brown")
.InsertItem(h,Nothing,"COO - James Lee")
h = .InsertItem(hRoot,Nothing,"HR Department")
.InsertItem(h,Nothing,"Recruiter - Jane Smith")
.InsertItem(h,Nothing,"HR Assistant - Bob Green")
.ExpandItem(h) = True
h = .InsertItem(h,Nothing,"Engineering")
.InsertItem(h,Nothing,"Software Team")
h = .InsertItem(h,Nothing,"Lead Developer - Mark H.")
.InsertItem(h,Nothing,"Frontend Dev - Emily R.")
.InsertItem(h,Nothing,"Backend Dev - Tom W.")
.InsertItem(hRoot,Nothing,"QA Team")
End With
.EndUpdate()
End With
|
2392
|
How can I update the bar's start position without affecting its working duration

Dim h
With AxG2antt1
.BeginUpdate()
With .Chart
.FirstVisibleDate = #12/31/2009#
.LevelCount = 2
.PaneWidth(False) = 96
With .Bars.Add("Task:Split")
.Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarKeepWorkingCount) = True
.Shortcut = "Task"
End With
End With
.Columns.Add("")
With .Items
h = .AddItem("Item")
.AddBar(h,"Task",#1/4/2010#,#1/9/2010#,"")
.ItemBar(h,"",EXG2ANTTLib.ItemBarPropertyEnum.exBarMoveStart) = #1/7/2010#
End With
.EndUpdate()
End With
|
2391
|
How can I update the bar's start position without affecting its duration

Dim h
With AxG2antt1
.BeginUpdate()
With .Chart
.FirstVisibleDate = #12/31/2009#
.LevelCount = 2
.PaneWidth(False) = 96
End With
.Columns.Add("")
With .Items
h = .AddItem("Item")
.AddBar(h,"Task",#1/4/2010#,#1/9/2010#,"")
.ItemBar(h,"",EXG2ANTTLib.ItemBarPropertyEnum.exBarMoveStart) = #1/7/2010#
End With
.EndUpdate()
End With
|
2390
|
Change the tooltip position for the chart
' ToolTip event - Fired when the control prepares the object's tooltip.
Private Sub AxG2antt1_ToolTip(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_ToolTipEvent) Handles AxG2antt1.ToolTip
With AxG2antt1
e.y = .FormatABC("A = -6 ? B + 60 : B",e.colIndex,e.y)
End With
End Sub
With AxG2antt1
.BeginUpdate()
With .Chart
.ToolTip = "This is a bit of text that's shown while hovers the level"
.FirstVisibleDate = #12/31/2009#
.LevelCount = 2
.PaneWidth(False) = 96
End With
.Columns.Add("Type")
With .Items
.AddBar(.AddItem("Item 1"),"Task",#1/4/2010#,#1/9/2010#)
End With
.EndUpdate()
End With
|
2389
|
Change the tooltip position for the overview
' ToolTip event - Fired when the control prepares the object's tooltip.
Private Sub AxG2antt1_ToolTip(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_ToolTipEvent) Handles AxG2antt1.ToolTip
With AxG2antt1
e.x = .FormatABC("A = -5 ? B - C/2 : B",e.colIndex,e.x,e.cX)
End With
End Sub
With AxG2antt1
.BeginUpdate()
With .Chart
.OverviewVisible = EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowAll
.OverviewToolTip = "This is a bit of text that's shown while hovers the level"
.FirstVisibleDate = #12/31/2009#
.LevelCount = 2
.PaneWidth(False) = 96
End With
.Columns.Add("Type")
With .Items
.AddBar(.AddItem("Item 1"),"Task",#1/4/2010#,#1/9/2010#)
End With
.EndUpdate()
End With
|
2388
|
Change the tooltip position for the note
' ToolTip event - Fired when the control prepares the object's tooltip.
Private Sub AxG2antt1_ToolTip(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_ToolTipEvent) Handles AxG2antt1.ToolTip
With AxG2antt1
e.y = .FormatABC("A = -4 ? B - 6 : B",e.colIndex,e.y)
End With
End Sub
With AxG2antt1
.BeginUpdate()
With .Chart
.FirstVisibleDate = #12/31/2009#
.LevelCount = 2
.PaneWidth(False) = 96
End With
.Columns.Add("Type")
With .Items
.AddBar(.AddItem("Item 1"),"Task",#1/4/2010#,#1/9/2010#)
End With
With .Chart.Notes
.Add("1S",AxG2antt1.Items.FirstVisibleItem,"","Note").PartToolTip(EXG2ANTTLib.NotePartEnum.exNoteEnd) = "This is a bit of text that's shown while hovers the level"
End With
.EndUpdate()
End With
|
2387
|
Change the tooltip position for the link
' ToolTip event - Fired when the control prepares the object's tooltip.
Private Sub AxG2antt1_ToolTip(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_ToolTipEvent) Handles AxG2antt1.ToolTip
With AxG2antt1
e.x = .FormatABC("A = -3 ? B - 16 : B",e.colIndex,e.x)
End With
End Sub
With AxG2antt1
.BeginUpdate()
With .Chart
.FirstVisibleDate = #12/31/2009#
.LevelCount = 2
.PaneWidth(False) = 96
End With
.Columns.Add("Type")
With .Items
.AddBar(.AddItem("Item 1"),"Task",#1/4/2010#,#1/9/2010#)
.AddBar(.AddItem("Item 1"),"Task",#1/4/2010#,#1/9/2010#)
.AddLink("link",.ItemByIndex(0),"",.ItemByIndex(1),"")
.Link("link",EXG2ANTTLib.LinkPropertyEnum.exLinkToolTip) = "This is a bit of text that's shown while hovers the level"
End With
.EndUpdate()
End With
|
2386
|
Change the tooltip position for the bar
' ToolTip event - Fired when the control prepares the object's tooltip.
Private Sub AxG2antt1_ToolTip(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_ToolTipEvent) Handles AxG2antt1.ToolTip
With AxG2antt1
e.x = .FormatABC("A = -2 ? B + 16 : B",e.colIndex,e.x)
End With
End Sub
With AxG2antt1
.BeginUpdate()
With .Chart
.FirstVisibleDate = #12/31/2009#
.LevelCount = 2
.PaneWidth(False) = 96
.Bars.Item("Task").Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip) = "This is a bit of text that's shown while hovers the level"
End With
.Columns.Add("Type")
With .Items
.AddBar(.AddItem("Original"),"Task",#1/4/2010#,#1/9/2010#,"")
End With
.EndUpdate()
End With
|
2385
|
Change the tooltip position for the chart's level/header
' ToolTip event - Fired when the control prepares the object's tooltip.
Private Sub AxG2antt1_ToolTip(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_ToolTipEvent) Handles AxG2antt1.ToolTip
With AxG2antt1
e.y = .FormatABC("A = -1 ? B + 16 : B",e.colIndex,e.y)
End With
End Sub
With AxG2antt1
.BeginUpdate()
With .Chart
.FirstVisibleDate = #12/31/2009#
.LevelCount = 2
.PaneWidth(False) = 96
.Level(0).ToolTip = "This is a bit of text that's shown while hovers the level"
End With
.Columns.Add("Type")
With .Items
.AddBar(.AddItem("Original"),"Task",#1/4/2010#,#1/9/2010#,"")
End With
.EndUpdate()
End With
|
2384
|
Change the tooltip position for the column
' ToolTip event - Fired when the control prepares the object's tooltip.
Private Sub AxG2antt1_ToolTip(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_ToolTipEvent) Handles AxG2antt1.ToolTip
With AxG2antt1
e.x = .FormatABC("A >= 0 ? B - 64 : B",e.colIndex,e.x)
e.y = .FormatABC("A >= 0 ? B + 24 : B",e.colIndex,e.y)
End With
End Sub
With AxG2antt1
.BeginUpdate()
With .Chart
.FirstVisibleDate = #12/31/2009#
.LevelCount = 2
.PaneWidth(False) = 96
End With
.Columns.Add("Type").ToolTip = "This is a bit of text that's shown while hovers the column"
With .Items
.AddBar(.AddItem("Original"),"Task",#1/4/2010#,#1/9/2010#,"")
End With
.EndUpdate()
End With
|
2383
|
Change the properties of bars within the specified date range

With AxG2antt1
.BeginUpdate()
.Columns.Add("Tasks")
With .Chart
.FirstVisibleDate = #8/1/2017#
.LevelCount = 2
.PaneWidth(False) = 128
End With
With .Items
.AddBar(.AddItem("Task 1"),"Task",#8/2/2017#,#8/6/2017#)
.AddBar(.AddItem("Task 2"),"Task",#8/3/2017#,#8/9/2017#)
.AddBar(.AddItem("Task 3"),"Task",#8/4/2017#,#8/13/2017#)
.AddBar(.AddItem("Task 4"),"Task",#8/5/2017#,#8/16/2017#)
.ItemBarEx("(itembar(2) <= #8/9/2017#) and (itembar(1) >= #8/1/2017#)",EXG2ANTTLib.ItemBarPropertyEnum.exBarPattern) = 6
End With
.EndUpdate()
End With
|
2382
|
Set the base level in 3-day intervals

With AxG2antt1
.BeginUpdate()
With .Chart
.FirstVisibleDate = #3/17/2025#
.PaneWidth(False) = 128
.LevelCount = 3
.Level(2).Count = 3
.Level(1).Label = 256
With .Level(0)
.Label = 16
.Alignment = EXG2ANTTLib.AlignmentEnum.exHOutside Or EXG2ANTTLib.AlignmentEnum.CenterAlignment
End With
.UnitWidth = 64
End With
.EndUpdate()
End With
|
2381
|
I am using EBN for my milestone bars, but they appear very small on high DPI resolutions

With AxG2antt1
.BeginUpdate()
With .VisualAppearance
.Add(1,"gBFLBCJwBAEHhEJAAEhABM8GACAADACAxRDAMgBQKAAzQFAYahqGKGAAGOD4JhUAIIRZGMIjFDcEwxC6EX7kIAJCb+IIDATCIyjAIoWhxFKGZYlYAoJDENo0QRCcZTR" & _
"I8NQGCyEQwnOQZDiWFofR6CEIlAZJRjoOo5DJGGL0WAaAxCEzVMYjNBIUQTICBaCgOCLCgkYJWT5aMi2XZlWzdNhTVIfC4XYq+dp3UZJF4XXZtaTpPjALxwG5rerJGTk" & _
"P7hb74LauBzdAbHLaxTCsKwzEZtZBjWR4RimOY9RLEMqxbKcDxvIKnZzpehYHomCTlOjUdhzfYtKy+cp7azbejbJrmZ5DWzGbr3HC+Az3KK+cbyOo6XgVYaLZDjOh5Dh" & _
"kgwAY7mgdg5F2Hg2DIB5Xm0eA6F4HJ/HeLZPnGeg8F2TgHHuT5qm2fA8B4W5vjuY5vmSdQkle7p/m+dx+FwN5RHMYYfGeRZ5GYH42joAw+B+ZxmAcWwgBWYZ9gOHAGEY" & _
"ERdmEN5KBUaJghYXZEgKXI4G4Hh1GINIVl+A5akgdglgmIgoi0a4FmIOIiCMQJOjQRQJEAQCAgA==")
.Add(2,"CP:1 0 -1D 11D 1D")
.Add(3,"gBFLBCJwBAEHhEJAAEhABIICg6AADACAxRDAMgBQKAAzQFAYahqGKGAAGOD4JhUAIIRZGMIjFDcEwxC6EX7kIAJCb+IIDATCIyjAIoWhxFKGZYlYAoJDENo0QRCcZTR" & _
"I8NQGCyEQ4nOQZDiWFofR6CEIlAZJRjoOo5DJGGL1GAeAxCEzVMYjNBIUQTICBaCgOCAYhYcJWT5aMi2XZlWzaaBnWauC4rRrObp3XhbMB3TbkSznP66bhvXA7MrvBJ+" & _
"YDdGJLMwTC4YYrAGawe6MGxPEaRY7jeQ5Ha+KzxS7EWDXBTdCS1DBeD7pY76LouN45Ty7dAxLTNDyrKq0KzrWR7A7+ZTnXBFTDJXgSNThGx+cYfXCcJrGdYpEi2N6uHg" & _
"HAuCZJmScp4FyXBNnYB5SGcdSTiaGoMm+ZA7jsFpph8Shnk+Z5shMex4iuUADj+YZiHuPI+k8Z5km+cB8hcZgVlAWpfHeDZlHmX43ioCR6mCJ4pn0fANFMEI3gQSx3lE" & _
"bYBESV52AuBpgleNgHHkYQIEoFB9CESBRnCBohlgcgMgqYooD2VRwiIWBJAODBLHiHgfHoIoYmYLIOh+SJeCGBJjCAAY2GoHR3B4KoRmOSQmCuERHmkDA/ECZJpDISIO" & _
"mUSROAuEwkmiTgigSHwCkiIgjiWYg6FaEogjMUIyCaZhiG4P4FCWKQCDWC5ElmBhhhiZRYmoaYaGaOQFG2DQfAmXhnDsTAyiqhwoBoDoGiAZ5piocINCEZYyHyHAohoH" & _
"oEiSaQqCYeYFGAJZ2g8eIEloJJ3DKSxqHyNoliiORuhgXhbkmbomh8Zh5iaIooioShygwXwqhWcobHWHB3GKJYbhmRIaAMYZrHcChMiWa5alWE4NCSapOj0WpsGsAomj" & _
"IahrC6GY0heAxYlwNwtGMcpUHObY1l6WY2G2VY5AMOpRBQJQBICA=")
.Add(4,"CP:3 0 -1D 11D 1D")
End With
With .Chart
.PaneWidth(False) = 128
.FirstVisibleDate = #1/1/2001#
With .Bars.Copy("Milestone","Milestonee3")
.Color = &H2000000
.Height = 22
End With
With .Bars.Copy("Milestone","Milestonee4")
.Color = &H4000000
.Height = 22
End With
End With
.DefaultItemHeight = 28
.Columns.Add("Tasks")
With .Items
.AddBar(.AddItem("Milestone"),"Milestone",#1/2/2001#,#1/2/2001#)
.AddBar(.AddItem("milestonee3.ebn"),"Milestonee3",#1/2/2001#,#1/2/2001#)
.AddBar(.AddItem("milestonee4.ebn"),"Milestonee4",#1/2/2001#,#1/2/2001#)
End With
.EndUpdate()
End With
|
2380
|
How can I vertically scroll the control
' AddItem event - Occurs after a new Item has been inserted to Items collection.
Private Sub AxG2antt1_AddItem(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_AddItemEvent) Handles AxG2antt1.AddItem
With AxG2antt1
With .Items
.AddBar(e.item,"Task",.CellValue(e.item,2),.CellValue(e.item,4))
End With
End With
End Sub
With AxG2antt1
.BeginUpdate()
.ColumnAutoResize = False
.DataSource = CreateObject("DAO.DBEngine.120").OpenDatabase("C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb").OpenRecordset("Orders").OpenDatabase("C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb").OpenRecordset("Orders")
With .Chart
.FirstVisibleDate = #8/4/1994#
.LevelCount = 2
.PaneWidth(False) = 256
End With
.Items.AllowCellValueToItemBar = True
.Columns.Item(2).Def(EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty) = 1
.Columns.Item(4).Def(EXG2ANTTLib.DefColumnEnum.exCellValueToItemBarProperty) = 2
.Layout = "Collapse="""";VScroll=10"
.EndUpdate()
End With
|
2379
|
Export the items as a two-dimensional array

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.PutItems(.Export("array","all"))
.EndUpdate()
End With
|
2378
|
Export only expanded items

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","only(expanded)") )
End With
|
2377
|
Export only selectable, sortable leaf items that are neither locked nor dividers

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","only(leaf,sortable,selectable,!divider,!locked)") )
End With
|
2376
|
Export only non-divider items

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","only(!divider)") )
End With
|
2375
|
Export only selectable items

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","only(selectable)") )
End With
|
2374
|
Export only sortable, but not locked items

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","only(sortable,!locked)") )
End With
|
2373
|
Export only checked items on specified column

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","only(checked[0])") )
End With
|
2372
|
Export only filtered, not locked or divider items

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","only(visible,!locked,!divider)") )
End With
|
2371
|
Export only selected items

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","only(selected)") )
End With
|
2370
|
Export only locked items

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","only(locked)") )
End With
|
2369
|
Export the leaf items of the control, excluding parent or grouped items

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","leaf") )
End With
|
2368
|
Export all checked and visible items (the first column in the columns list specifies the index of the column used to query the checkbox state)

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","chk") )
End With
|
2367
|
Export the selected-items

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","sel") )
End With
|
2366
|
Export the visible items, excluding child items of collapsed elements, non-visible items (such as those with a height of 0), and items that do not match the current filter

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","vis") )
End With
|
2365
|
Export all items, including the hidden or collapsed items

Dim g1,g2,h,r
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.ScrollBySingleLine = True
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exTop) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = EXG2ANTTLib.ValueFormatEnum.exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,Nothing,"Group A")
.CellValue(.InsertItem(g1,Nothing,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,Nothing,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,Nothing,"Group B")
.CellValue(.InsertItem(g2,Nothing,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,Nothing,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,Nothing,"Group C")
.CellValue(.InsertItem(g1,Nothing,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,Nothing,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate()
Debug.Print( .Export("","all") )
End With
|
2364
|
Bolds only the expanded items

Dim h
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
.ConditionalFormats.Add("%CX0").Bold = True
.Columns.Add("Description")
With .Items
h = .AddItem("Root 1")
.InsertItem(h,Nothing,"Child 1")
.InsertItem(.InsertItem(h,Nothing,"Child 2"),Nothing,"Sub-Child 2")
.CellState(.InsertItem(h,Nothing,"Child 3"),0) = 1
.ExpandItem(h) = True
h = .AddItem("Root 2")
.InsertItem(h,Nothing,"Child 1")
.InsertItem(h,Nothing,"Child 2")
.InsertItem(h,Nothing,"Child 3")
End With
.EndUpdate()
End With
|
2363
|
Displays the root item's index and value/caption using expressions

Dim h
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
.AutoDrag = EXG2ANTTLib.AutoDragEnum.exAutoDragPositionAny
.AllowCopyPaste = EXG2ANTTLib.AllowCopyPasteEnum.exAllowPaste Or EXG2ANTTLib.AllowCopyPasteEnum.exAllowCut Or EXG2ANTTLib.AllowCopyPasteEnum.exAllowCopy
.SingleSel = False
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exRowLines
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesSolid
.GridLineColor = RGB(208,208,208)
.ConditionalFormats.Add("%CC0 and %CX0").Bold = True
With .ConditionalFormats.Add("1")
.Bold = True
.ApplyTo = &H2
End With
With .Columns.Add("Description")
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
.PartialCheck = True
End With
With .Columns.Add("Index")
.FormatColumn = "1 index ``"
.Position = 0
.Width = 16
End With
With .Columns.Add("Root-Index")
.FormatColumn = "root(1 index ``)"
.Position = 1
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellBackColor) = 15790320
End With
With .Columns.Add("Root-Value")
.FormatColumn = "root(%0)"
.Position = 2
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellBackColor) = 15790320
End With
With .Items
h = .AddItem("Root 1")
.InsertItem(h,Nothing,"Child 1")
.InsertItem(.InsertItem(h,Nothing,"Child 2"),Nothing,"Sub-Child 2")
.CellState(.InsertItem(h,Nothing,"Child 3"),0) = 1
.ExpandItem(h) = True
h = .AddItem("Root 2")
.InsertItem(h,Nothing,"Child 1")
.InsertItem(h,Nothing,"Child 2")
.InsertItem(h,Nothing,"Child 3")
.ExpandItem(h) = True
End With
.EndUpdate()
End With
|
2362
|
Displays the parent item's index and caption/value using expressions

Dim h
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
.AutoDrag = EXG2ANTTLib.AutoDragEnum.exAutoDragPositionAny
.AllowCopyPaste = EXG2ANTTLib.AllowCopyPasteEnum.exAllowPaste Or EXG2ANTTLib.AllowCopyPasteEnum.exAllowCut Or EXG2ANTTLib.AllowCopyPasteEnum.exAllowCopy
.SingleSel = False
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exRowLines
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesSolid
.GridLineColor = RGB(208,208,208)
.ConditionalFormats.Add("%CC0 and %CX0").Bold = True
With .ConditionalFormats.Add("1")
.Bold = True
.ApplyTo = &H2
End With
With .Columns.Add("Description")
.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
.PartialCheck = True
End With
With .Columns.Add("Index")
.FormatColumn = "1 index `I`"
.Position = 0
.Width = 16
End With
With .Columns.Add("Parent-Index")
.FormatColumn = "parent(1 index `I`)"
.Position = 1
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellBackColor) = 15790320
End With
With .Columns.Add("Parent-Value")
.FormatColumn = "parent(%0)"
.Position = 2
.Width = 32
.Def(EXG2ANTTLib.DefColumnEnum.exCellBackColor) = 15790320
End With
With .Items
h = .AddItem("Root 1")
.InsertItem(h,Nothing,"Child 1")
.InsertItem(.InsertItem(h,Nothing,"Child 2"),Nothing,"Sub-Child 2")
.CellState(.InsertItem(h,Nothing,"Child 3"),0) = 1
.ExpandItem(h) = True
h = .AddItem("Root 2")
.InsertItem(h,Nothing,"Child 1")
.InsertItem(h,Nothing,"Child 2")
.InsertItem(h,Nothing,"Child 3")
.ExpandItem(h) = True
End With
.EndUpdate()
End With
|
2361
|
Copying and Pasting the Selection Programmatically
Dim h
With AxG2antt1
.BeginUpdate()
.Columns.Add("Tasks")
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
With .Chart
.LevelCount = 2
.FirstVisibleDate = #1/1/2025#
.PaneWidth(False) = 128
.SelBackColor = AxG2antt1.SelBackColor
.Bars.Item("Task").OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsCascade
End With
.SingleSel = False
With .Items
.AddItem("Tasks")
h = .AddItem("Task 1")
.AddBar(h,"Task",#1/2/2025#,#1/8/2025#,"T1")
.AddBar(h,"Task",#1/7/2025#,#1/13/2025#,"T2")
.SelectItem(h) = True
h = .AddItem("Task 2")
.AddBar(h,"Task",#1/2/2025#,#1/8/2025#,"T1")
.AddBar(h,"Task",#1/7/2025#,#1/13/2025#,"T2")
.SelectItem(h) = True
End With
.IndentSelection(False)
.CopySelection()
.Items.UnselectAll()
.Paste()
.EndUpdate()
End With
|
2360
|
Enable Copy, Cut and Paste Clipboard operations
Dim h
With AxG2antt1
.BeginUpdate()
.Columns.Add("Tasks")
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
.AllowCopyPaste = EXG2ANTTLib.AllowCopyPasteEnum.exAllowPaste Or EXG2ANTTLib.AllowCopyPasteEnum.exAllowCut Or EXG2ANTTLib.AllowCopyPasteEnum.exAllowCopy
.ConditionalFormats.Add("%CC0 and %CX0").Bold = True
.ConditionalFormats.Add("1")
With .Chart
.LevelCount = 2
.FirstVisibleDate = #1/1/2025#
.PaneWidth(False) = 128
.SelBackColor = AxG2antt1.SelBackColor
.Bars.Item("Task").OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsCascade
End With
.SingleSel = False
With .Items
.AddItem("Tasks")
h = .AddItem("Task 1")
.AddBar(h,"Task",#1/2/2025#,#1/8/2025#,"T1")
.AddBar(h,"Task",#1/7/2025#,#1/13/2025#,"T2")
.SelectItem(h) = True
h = .AddItem("Task 2")
.AddBar(h,"Task",#1/2/2025#,#1/8/2025#,"T1")
.AddBar(h,"Task",#1/7/2025#,#1/13/2025#,"T2")
.SelectItem(h) = True
End With
.IndentSelection(False)
.EndUpdate()
End With
|
2359
|
Adjusts the hierarchy of selected items by changing their parent

With AxG2antt1
.BeginUpdate()
.Columns.Add("Tasks")
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
.SingleSel = False
With .Items
.AddItem("Tasks")
.SelectItem(.AddItem("Task A")) = True
.SelectItem(.AddItem("Task B")) = True
End With
.IndentSelection(False)
.EndUpdate()
End With
|
2358
|
How can I change the visual appearance for selected bars (EBN, frame, dash, enlarged)

Dim h
With AxG2antt1
.BeginUpdate()
With .VisualAppearance
.Add(2,"gBFLBCJwBAEHhEJAAEhABMcGACAADACAxRDAMgBQKAAzQFAYahqGKGAAGOD4JhUAIIRZGMIjFDcEwxC6NIpAWCYRDEMw4AJCI4DRCIZBuGyPRhASQZUhmHIDTbIEBxf" & _
"IMIxLE6YaBjObIaoSGYfUhCMowG79GgBJp/YqncaKCgSHwyUrNEbgRDQEw9L6BaxqCj6OhWLQ1CTZdowSKoYTXBq3IhkGiYZpyO5gABYVLWHY0ExNFCVJYjOT5RiONaH" & _
"ABOM43JKkfT9IC/KpxGhoWxSdo6ABXVz2DBNRz5EjHaoyHQ5Ypmc4JZbleZZTbFdSjT6BbS2KzLRzSb5aXhqMI6XD+XTJKK+YIkeqZLjGJaEYblGKZPruOz3MrQOCwCA" & _
"fBafZHBsaYojqmovhkSpnGuegbBiXYjGccJblsdpxFqTgyjeW5Nl4fAbnyLpmBIUA0hiToHFOmBjFcRgECENQHEYQxkCQKBumCBZcBgRYPkYIQaGwERoEEFRsBUCBWBa" & _
"BZhCafgYgaYYYHIHh4iGeIGBWBJiCgYgPgkYR4h4KIIl8JIGBkUwUmOLRyECUAQIC")
.Add(1,"CP:2 -2 -2 2 2")
End With
With .Chart
.LevelCount = 2
.FirstVisibleDate = #1/1/2002#
.SelBarColor = &H1000000
.PaneWidth(False) = 48
End With
.Columns.Add("Task")
With .Items
.AddItem()
h = .AddItem("Task 1")
.AddBar(h,"Task",#1/2/2002#,#1/4/2002#,"A")
.AddBar(h,"Task",#1/6/2002#,#1/10/2002#,"B")
.AddBar(h,"Task",#1/11/2002#,#1/14/2002#,"C")
.ItemBar(h,"A",EXG2ANTTLib.ItemBarPropertyEnum.exBarSelected) = True
.ItemBar(h,"B",EXG2ANTTLib.ItemBarPropertyEnum.exBarSelected) = True
.AddItem()
End With
.EndUpdate()
End With
|
2357
|
Specify the size of the Columns panel

With AxG2antt1
.BeginUpdate()
.HeaderHeight = 24
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
With .Columns
.Add("City")
.Add("Start").Visible = False
.Add("End").Visible = False
End With
.ColumnsFloatBarRect = ",,96"
.ColumnsFloatBarVisible = EXG2ANTTLib.ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleAsChild Or EXG2ANTTLib.ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleIncludeCheckColumns
.EndUpdate()
End With
|
2356
|
Show a vertical line between pivot and Columns panel (EBN color)

With AxG2antt1
.BeginUpdate()
.VisualAppearance.Add(1,"gBFLBCJwBAEHhEJAAEhABRsIQAAYAQGKIYBkAKBQAGaAoDDUNQxQwAAxwfBMKgBBCLIxhEYobgmGIXRpFICQTIcBhaGIZRiAKCRTDmHwyRCNIwCLD8QxtDqBY4gOZZX" & _
"hal4cJTgMaBYi+Pw3DZHcbvBRkewzHQAKgnSjoDhEMg1CTVVYTDKdOSzDyEX7sIAACpOIZQVJVEY1VT8cyxIyEZimSypWqiYJ0Ty6cQwTAIgI")
.set_Background(EXG2ANTTLib.BackgroundPartEnum.exColumnsFloatBackColor,16777216)
.HeaderHeight = 24
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
With .Columns
.Add("City")
.Add("Start").Visible = False
.Add("End").Visible = False
End With
.ColumnsFloatBarVisible = EXG2ANTTLib.ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleAsChild Or EXG2ANTTLib.ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleIncludeCheckColumns
.EndUpdate()
End With
|
2355
|
Change the background of the Columns panel (EBN color)

With AxG2antt1
.BeginUpdate()
.VisualAppearance.Add(1,"gBFLBCJwBAEHhEJAAEhABNoCg6AADACAxRDAMgBQKAAzQFAYahqGKGAAGOD4JhUAIIRZGMIjFDcEwxC6NIpAWLoJDCH4mSTHYxgJIMWwzDiBZgkCA4fiGEYnThCIxzT" & _
"J0aw1CKbYRAKCUKoUAJFsSnQAJIgOO4lULPMIhDDQKQTIKBahoehqIhaEQyDSJNb2DCIahhMSEbKtCooDhGFZUWzLVxTJJNawHJqJJDuOTpSjKH4+RjWFKUXR9b4BJSN" & _
"AgqeCQTiSWZEVxRUS0XbGCyZLSQY7uAAMKgOVoDYzdGLwHTtOwrMa1QAsDSbKqWZ5uRpHcQ5aAGN5DPbMbqwOaqLznAaLQLtG4RTikVRPTDYaj437+OaHGyNbI6HTNPp" & _
"TlWDJWjYXI8l8C4fg6GYAAEEISgGJJGHQOocgyIwYnqKhYAAIQTH2MYRjQJBRAmZptmEAYIjGU5dk8UgOFgBJUgCTQIBYBoBmCCAmAqApghgDJUDmYQFCCZoEk2OBUm+" & _
"BZPCgZgagaYZIHYHoHmGWBcm8NwiEiFJVgmYgji4Kg6GKSI2C6C5jAiRgygwIojiycINkyeJmAYPJjkiTg+g+ZAIkCdIQkyWQWDuDxkBkJhKguZAzlIRQzGQc5ODWFJl" & _
"EkVhWhWZYJFYTYTmUE4yF6F5mAmBhihiZhJhYX4WmQaAUnWGpOlmNhuhuZwJkYcocmcSY4naHZlkmKhrDuJ5JnYfofmgCgGgKIJnlmXJ2h4TQKBosRokoNoOiOaQKDSd" & _
"4kmiChMncPBpgoZoaiaaZKHaHonmmE5iiKJRpDicomimaoKiaKoqmqSoeiIPgogqPotiyaxKlYPA+GuCqbBMa5KnaPovmwCwGj6LgP24RIhiyCwmkqMpsksNpKD6LQLB" & _
"qOIzi0SxWlaHZtAOahPssM5Wi+IYtlsXpijKbZ5lyTo5mAE4UlqOpjHOQpEjubyanKPJvEuNgVj2TY1CCao+k2G52AyP5wAwBp9DYZZ1CCaxsAABAEICA")
.set_Background(EXG2ANTTLib.BackgroundPartEnum.exColumnsFloatBackColor,16777216)
.HeaderHeight = 24
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
With .Columns
.Add("City")
.Add("Start").Visible = False
.Add("End").Visible = False
End With
.ColumnsFloatBarVisible = EXG2ANTTLib.ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleAsChild Or EXG2ANTTLib.ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleIncludeCheckColumns
.EndUpdate()
End With
|
2354
|
Change the background of the Columns panel (solid color)

With AxG2antt1
.BeginUpdate()
.HeaderHeight = 24
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
With .Columns
.Add("City")
.Add("Start").Visible = False
.Add("End").Visible = False
End With
.ColumnsFloatBarVisible = EXG2ANTTLib.ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleAsChild Or EXG2ANTTLib.ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleIncludeCheckColumns
.set_Background(EXG2ANTTLib.BackgroundPartEnum.exColumnsFloatBackColor,15790320)
.EndUpdate()
End With
|
2353
|
Change the visual appearance of the Columns panel

With AxG2antt1
.BeginUpdate()
.VisualAppearance.Add(1,"gBFLBCJwBAEHhEJAAEhABNoCg6AADACAxRDAMgBQKAAzQFAYahqGKGAAGOD4JhUAIIRZGMIjFDcEwxC6NIpAWLoJDCH4mSTHYxgJIMWwzDiBZgkCA4fiGEYnThCIxzT" & _
"J0aw1CKbYRAKCUKoUAJFsSnQAJIgOO4lULPMIhDDQKQTIKBahoehqIhaEQyDSJNb2DCIahhMSEbKtCooDhGFZUWzLVxTJJNawHJqJJDuOTpSjKH4+RjWFKUXR9b4BJSN" & _
"AgqeCQTiSWZEVxRUS0XbGCyZLSQY7uAAMKgOVoDYzdGLwHTtOwrMa1QAsDSbKqWZ5uRpHcQ5aAGN5DPbMbqwOaqLznAaLQLtG4RTikVRPTDYaj437+OaHGyNbI6HTNPp" & _
"TlWDJWjYXI8l8C4fg6GYAAEEISgGJJGHQOocgyIwYnqKhYAAIQTH2MYRjQJBRAmZptmEAYIjGU5dk8UgOFgBJUgCTQIBYBoBmCCAmAqApghgDJUDmYQFCCZoEk2OBUm+" & _
"BZPCgZgagaYZIHYHoHmGWBcm8NwiEiFJVgmYgji4Kg6GKSI2C6C5jAiRgygwIojiycINkyeJmAYPJjkiTg+g+ZAIkCdIQkyWQWDuDxkBkJhKguZAzlIRQzGQc5ODWFJl" & _
"EkVhWhWZYJFYTYTmUE4yF6F5mAmBhihiZhJhYX4WmQaAUnWGpOlmNhuhuZwJkYcocmcSY4naHZlkmKhrDuJ5JnYfofmgCgGgKIJnlmXJ2h4TQKBosRokoNoOiOaQKDSd" & _
"4kmiChMncPBpgoZoaiaaZKHaHonmmE5iiKJRpDicomimaoKiaKoqmqSoeiIPgogqPotiyaxKlYPA+GuCqbBMa5KnaPovmwCwGj6LgP24RIhiyCwmkqMpsksNpKD6LQLB" & _
"qOIzi0SxWlaHZtAOahPssM5Wi+IYtlsXpijKbZ5lyTo5mAE4UlqOpjHOQpEjubyanKPJvEuNgVj2TY1CCao+k2G52AyP5wAwBp9DYZZ1CCaxsAABAEICA")
.set_Background(EXG2ANTTLib.BackgroundPartEnum.exColumnsFloatAppearance,16777216)
.set_Background(EXG2ANTTLib.BackgroundPartEnum.exColumnsFloatCaptionBackColor,16185078)
.GetOcx().BackColorHeader = &H1000000
.HeaderHeight = 24
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
With .Columns
.Add("City")
.Add("Start").Visible = False
.Add("End").Visible = False
End With
.set_Description(EXG2ANTTLib.DescriptionTypeEnum.exColumnsFloatBar,"Show/Hide")
.ColumnsFloatBarVisible = EXG2ANTTLib.ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleIncludeCheckColumns
.EndUpdate()
End With
|
2352
|
Defines the symbol used to indicate repeated captions, providing a clear visual cue for identical entries (ditto mark)

With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exRowLines
.Columns.Add("Country").ShowIdem = "<fgcolor gray>〃"
With .Items
.AddItem("Spain")
.AddItem("Spain")
.AddItem("Spain")
.AddItem("Spain")
.AddItem("Germany")
.AddItem("Germany")
.AddItem("Germany")
.AddItem("Germany")
End With
.EndUpdate()
End With
|
2351
|
Defines the symbol used to indicate repeated captions, providing a clear visual cue for identical entries (space)

With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exRowLines
.Columns.Add("Country").ShowIdem = " "
With .Items
.AddItem("Spain")
.AddItem("Spain")
.AddItem("Spain")
.AddItem("Spain")
.AddItem("Germany")
.AddItem("Germany")
.AddItem("Germany")
.AddItem("Germany")
End With
.EndUpdate()
End With
|
2350
|
Displays a glitch funnel for drop-down filter buttons (empty or active)

With AxG2antt1
.BeginUpdate()
With .VisualAppearance
.RenderType = -1
.Add(1,"gBFLBCJwBAEHhEJAAEhABa8IQAAYAQGKIYBkAKBQAGaAoDDUNQxQwAAxwfBMKgBBCLIxhEYobgmGIXRpFMbxCKQahLEiTIhGUYJHgmK4tRiAUgxVDkBxrECZYqjcBZO" & _
"iwLQ2TxDM7DNKUCBnIoABhGOaYDh+IQNQjUFKwTRFGRxK4EIRKAyTDLQdRyGSMMbjdQpBCbMiMRqhESKRq2UwYRYCFS1NalaztO6BUAvK67YrWez/YBfF+SfwGeqDYRe" & _
"WAPfgWERnQrGMLxbD8KwZAKTRjkGJ4XhuB41TbQMqufL9ByXHKSSDpGjaXjeO5VVjYNAvS69UzXNq3bhtQAOXCMEwCgI=")
.Add(2,"CP:1 -2 0 0 0")
End With
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exAllLines
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesGeometric
.ShowFocusRect = False
.set_Background(EXG2ANTTLib.BackgroundPartEnum.exHeaderFilterBarButton,33554432)
.set_Background(EXG2ANTTLib.BackgroundPartEnum.exHeaderFilterBarActive,33554433)
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.BackColorHeader = RGB(255,255,255)
.HeaderHeight = 24
.HeaderVisible = EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels
With .Columns.Add("1st col")
.DisplayFilterButton = True
.DisplayFilterPattern = False
.Filter = "Item B"
.FilterType = EXG2ANTTLib.FilterTypeEnum.exFilter
End With
.Columns.Add("2nd col")
With .Items
.AddItem("Item A")
.AddItem("Item B")
.AddItem("Item C")
End With
.ApplyFilter()
.EndUpdate()
End With
|
2349
|
Stack vs Cascade

Dim h
With AxG2antt1
.BeginUpdate()
.ScrollBySingleLine = True
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Flat
.Columns.Add("Type")
.BackColorAlternate = RGB(240,240,240)
With .Chart
.LevelCount = 2
.AllowCreateBar = EXG2ANTTLib.CreateBarEnum.exCreateBarAuto
.AllowLinkBars = False
.ResizeUnitScale = EXG2ANTTLib.UnitEnum.exHour
.PaneWidth(False) = 128
.FirstVisibleDate = #1/1/2001#
With .Bars.Copy("Task","T1")
.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsCascade
.Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption) = "<%=%9%>"
End With
With .Bars.Copy("Task","T2")
.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
.Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption) = "<%=%9%>"
End With
End With
With .Items
h = .AddItem("Cascade")
.AddBar(h,"T1",#1/2/2001#,#1/4/2001#,"A1")
.AddBar(h,"T1",#1/3/2001#,#1/5/2001#,"A2")
.AddBar(h,"T1",#1/4/2001#,#1/7/2001#,"A3")
.AddBar(h,"T1",#1/2/2001#,#1/7/2001#,"A4")
.AddBar(h,"T1",#1/8/2001#,#1/12/2001#,"A5")
.AddBar(h,"T1",#1/8/2001#,#1/12/2001#,"A6")
.AddBar(h,"T1",#1/8/2001#,#1/12/2001#,"A7")
.AddBar(h,"T1",#1/8/2001#,#1/12/2001#,"A8")
.AddBar(h,"T1",#1/8/2001#,#1/12/2001#,"A9")
.AddBar(h,"T1",#1/8/2001#,#1/12/2001#,"AA")
h = .AddItem("Stack-AutoArrange")
.AddBar(h,"T2",#1/2/2001#,#1/4/2001#,"A1")
.AddBar(h,"T2",#1/3/2001#,#1/5/2001#,"A2")
.AddBar(h,"T2",#1/4/2001#,#1/7/2001#,"A3")
.AddBar(h,"T2",#1/2/2001#,#1/7/2001#,"A4")
.AddBar(h,"T2",#1/8/2001#,#1/12/2001#,"A5")
.AddBar(h,"T2",#1/8/2001#,#1/12/2001#,"A6")
.AddBar(h,"T2",#1/8/2001#,#1/12/2001#,"A7")
.AddBar(h,"T2",#1/8/2001#,#1/12/2001#,"A8")
.AddBar(h,"T2",#1/8/2001#,#1/12/2001#,"A9")
.AddBar(h,"T2",#1/8/2001#,#1/12/2001#,"AA")
End With
.EndUpdate()
End With
|
2348
|
Horizontally(left) align the multi-line caption of the bar

Dim h
With AxG2antt1
.BeginUpdate()
.Columns.Add("Task")
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
With .Chart
.FirstVisibleDate = #1/1/2001#
.PaneWidth(False) = 128
.LevelCount = 2
End With
With .Items
.SelectableItem(.AddItem()) = False
h = .AddItem("Task 1")
.ItemHeight(h) = 42
.AddBar(h,"Task",#1/2/2001#,#1/7/2001#,"K1","This is a bit of 1'st line<br>2'nd line<br>3'rd line")
.ItemBar(h,"K1",EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption) = 0
End With
.EndUpdate()
End With
|
2347
|
Defines the colors, to display overlapping links

Dim h1
With AxG2antt1
.BeginUpdate()
.Columns.Add("Name")
.AntiAliasing = True
.OverlapLinksColors = "black,gray,lightgray"
With .Chart
.LevelCount = 2
.FirstVisibleDate = #12/28/2000#
.PaneWidth(False) = 64
.ShowLinks = EXG2ANTTLib.ShowExtendedLinksEnum.exChangeColorOnOverlap Or EXG2ANTTLib.ShowExtendedLinksEnum.exPreventOverlapMixt Or EXG2ANTTLib.ShowExtendedLinksEnum.exShowDefaultLinks
.NonworkingDays = 0
.LinksStyle = EXG2ANTTLib.LinkStyleEnum.exLinkSolid
End With
With .Items
.AddItem("")
h1 = .AddItem("Item 1")
.AddBar(h1,"Task",#1/3/2001#,#1/6/2001#,"A")
.AddBar(h1,"Task",#1/8/2001#,#1/11/2001#,"B")
.AddBar(h1,"Task",#1/13/2001#,#1/16/2001#,"C")
.AddBar(h1,"Task",#1/18/2001#,#1/21/2001#,"D")
.AddLink("Link1",h1,"D",h1,"A")
.AddLink("Link2",h1,"C",h1,"B")
End With
.EndUpdate()
End With
|
2346
|
The exPreventOverlapMixt option can be combined with the exChangeColorOnOverlap flag, allowing overlapping links to alternately adjust their width while also changing colors

Dim h1
With AxG2antt1
.BeginUpdate()
.Columns.Add("Name")
.AntiAliasing = True
With .Chart
.LevelCount = 2
.FirstVisibleDate = #12/28/2000#
.PaneWidth(False) = 64
.ShowLinks = EXG2ANTTLib.ShowExtendedLinksEnum.exChangeColorOnOverlap Or EXG2ANTTLib.ShowExtendedLinksEnum.exPreventOverlapMixt Or EXG2ANTTLib.ShowExtendedLinksEnum.exShowDefaultLinks
.NonworkingDays = 0
.LinksStyle = EXG2ANTTLib.LinkStyleEnum.exLinkSolid
End With
With .Items
.AddItem("")
h1 = .AddItem("Item 1")
.AddBar(h1,"Task",#1/3/2001#,#1/6/2001#,"A")
.AddBar(h1,"Task",#1/8/2001#,#1/11/2001#,"B")
.AddBar(h1,"Task",#1/13/2001#,#1/16/2001#,"C")
.AddBar(h1,"Task",#1/18/2001#,#1/21/2001#,"D")
.AddLink("Link1",h1,"D",h1,"A")
.AddLink("Link2",h1,"C",h1,"B")
End With
.EndUpdate()
End With
|
2345
|
The exChangeColorOnOverlap flag changes the color for links in areas where they overlap with other links, enhancing clarity and distinction between them

Dim h1
With AxG2antt1
.BeginUpdate()
.AntiAliasing = True
.Columns.Add("Name")
With .Chart
.LevelCount = 2
.FirstVisibleDate = #12/28/2000#
.PaneWidth(False) = 64
.ShowLinks = EXG2ANTTLib.ShowExtendedLinksEnum.exChangeColorOnOverlap Or EXG2ANTTLib.ShowExtendedLinksEnum.exShowDefaultLinks
.NonworkingDays = 0
.LinksStyle = EXG2ANTTLib.LinkStyleEnum.exLinkSolid
End With
With .Items
.AddItem("")
h1 = .AddItem("Item 1")
.AddBar(h1,"Task",#1/3/2001#,#1/6/2001#,"A")
.AddBar(h1,"Task",#1/8/2001#,#1/11/2001#,"B")
.AddBar(h1,"Task",#1/13/2001#,#1/16/2001#,"C")
.AddBar(h1,"Task",#1/18/2001#,#1/21/2001#,"D")
.AddLink("Link1",h1,"D",h1,"A")
.AddLink("Link2",h1,"C",h1,"B")
End With
.EndUpdate()
End With
|
2344
|
How can I assign a multiple-lines caption to an bar

Dim h
With AxG2antt1
.BeginUpdate()
.Columns.Add("Task")
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
With .Chart
.FirstVisibleDate = #1/1/2001#
.PaneWidth(False) = 128
.LevelCount = 2
End With
With .Items
.SelectableItem(.AddItem()) = False
h = .AddItem("Task 1")
.ItemHeight(h) = 42
.AddBar(h,"Task",#1/2/2001#,#1/7/2001#,"K1")
.ItemBar(h,"K1",EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption) = "This is a bit of 1'st line<br>2'nd line<br>3'rd line"
End With
.EndUpdate()
End With
|
2343
|
The text on the chart overlap the rest of the bars, while using OverlaidType property on exOverlaidBarsStack

Dim h
With AxG2antt1
.BeginUpdate()
With .Chart
.PaneWidth(False) = 48
.FirstVisibleDate = #1/3/2002#
.LevelCount = 2
.FirstWeekDay = EXG2ANTTLib.WeekDayEnum.exMonday
.Bars.Add("Text").Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption) = 0
With .Bars.Item("Task")
.Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption) = 0
.OverlaidType = EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsIncludeCaption Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStackAutoArrange Or EXG2ANTTLib.OverlaidBarsTypeEnum.exOverlaidBarsStack
.OverlaidGroup = "Text,Task"
End With
End With
.Columns.Add("Task")
With .Items
h = .AddItem("Default")
.AddBar(h,"Text",#1/4/2002#,#1/4/2002#,"","This is another text")
.AddBar(h,"Task",#1/6/2002#,#1/8/2002#,"A","This is a bit of text")
End With
.EndUpdate()
End With
|
2342
|
We are running our application on an Azure server using RDP, with the server language set to English. However, my client has their national language set to Swedish, but the tooltip is displaying dates in the English format (mm/dd/yyyy) instead of the Swedish format (yyyy-mm-dd) (method 2)

Dim h
With AxG2antt1
.BeginUpdate()
.Columns.Add("Def")
With .Chart
.AllowCreateBar = EXG2ANTTLib.CreateBarEnum.exNoCreateBar
.PaneWidth(False) = 64
.LevelCount = 2
.FirstVisibleDate = #1/1/2010#
.Bars.Item("Task").Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip) = "<%=`Start: ` + (date(%1) format `yyyy-MM-dd` )%>"
End With
With .Items
h = .AddItem("Task")
.AddBar(h,"Task",#1/2/2010#,#1/5/2010#,"A","A")
.AddBar(h,"Task",#1/5/2010#,#1/8/2010#,"B","B")
End With
.EndUpdate()
End With
|
2341
|
We are running our application on an Azure server using RDP, with the server language set to English. However, my client has their national language set to Swedish, but the tooltip is displaying dates in the English format (mm/dd/yyyy) instead of the Swedish format (yyyy-mm-dd) (method 1)

Dim h
With AxG2antt1
.BeginUpdate()
.Columns.Add("Def")
With .Chart
.AllowCreateBar = EXG2ANTTLib.CreateBarEnum.exNoCreateBar
.PaneWidth(False) = 64
.LevelCount = 2
.FirstVisibleDate = #1/1/2010#
.Bars.Item("Task").Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip) = "<%=`Start: ` + year(%1) + `-` + (month(%1) lpad `00`) + `-` + (day(%1) lpad `00`)%>"
End With
With .Items
h = .AddItem("Task")
.AddBar(h,"Task",#1/2/2010#,#1/5/2010#,"A","A")
.AddBar(h,"Task",#1/5/2010#,#1/8/2010#,"B","B")
End With
.EndUpdate()
End With
|
2340
|
How can I replace or add an icon at runtime

Dim h
With AxG2antt1
.BeginUpdate()
.ReplaceIcon("gAAAABgYACEHgUJFEEAAWhUJCEJEEJggEhMCYEXjUbjkJQECj8gj8hAEjkshYEpk8kf8ClsulsvAExmcvf83js5nU7nkCeEcn8boMaocXosCB9Hn09pkzcEuoL/fE+O" & _
"kYB0gB9YhIHrddgVcr9aktZADAD8+P8CgIA==")
.ReplaceIcon("C:\images\favicon.ico",0)
.Columns.Add("Task")
With .Chart
.FirstVisibleDate = #1/1/2001#
.PaneWidth(False) = 128
.LevelCount = 2
End With
With .Items
h = .AddItem("Task 1")
.AddBar(h,"Task",#1/2/2001#,#1/6/2001#,"K1")
.ItemBar(h,"K1",EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption) = "<img>1</img>"
End With
.EndUpdate()
End With
|
2339
|
How can I define the sensitivity for link selection when the user clicks or selects a link
' MouseMove event - Occurs when the user moves the mouse.
Private Sub AxG2antt1_MouseMoveEvent(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_MouseMoveEvent) Handles AxG2antt1.MouseMoveEvent
With AxG2antt1
Debug.Print( .Chart.LinkFromPoint(-1,-1) )
End With
End Sub
Dim h1,h2,h3
With AxG2antt1
.BeginUpdate()
.Columns.Add("Task")
With .Chart
.FirstVisibleDate = #12/29/2000#
.PaneWidth(False) = 64
.LevelCount = 2
.LinksWidth = 1026
End With
With .Items
h1 = .AddItem("Task 1")
.AddBar(h1,"Task",#1/2/2001#,#1/4/2001#,"K1")
.AddItem()
h2 = .AddItem("Task 2")
.AddBar(h2,"Task",#1/8/2001#,#1/10/2001#,"K2")
.AddLink("L1",h1,"K1",h2,"K2")
.AddItem()
h3 = .AddItem("Task 3")
.AddBar(h3,"Task",#1/14/2001#,#1/16/2001#,"K3")
.AddLink("L2",h2,"K2",h3,"K3")
End With
.EndUpdate()
End With
|
2338
|
How can I let the user to create task-bars for leaf0-items only, when AllowCreateBar is exCreateBarAuto
' CreateBar event - Fired when the user creates a new bar.
Private Sub AxG2antt1_CreateBar(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_CreateBarEvent) Handles AxG2antt1.CreateBar
With AxG2antt1
With .Items
Debug.Print( "Call RemoveBar if the ChildCount property returns a non-zero value" )
Debug.Print( .ChildCount(e.item) )
.RemoveBar(e.item,"newbar")
End With
End With
End Sub
Dim h
With AxG2antt1
.BeginUpdate()
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
.HeaderVisible = EXG2ANTTLib.HeaderVisibleEnum.exHeaderVisibleExtendLevels
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
With .Chart
.AllowCreateBar = EXG2ANTTLib.CreateBarEnum.exCreateBarAuto
.LevelCount = 2
.PaneWidth(False) = 128
End With
.Columns.Add("Task")
With .Items
h = .AddItem("Root")
.InsertItem(h,Nothing,"Child 1")
.InsertItem(h,Nothing,"Child 2")
.ExpandItem(h) = True
End With
.EndUpdate()
End With
|
2337
|
How can I convert the exBarStart/exBarEnd property to a string (by default it returns as VARIANT/VT_DATE type, method 3)

' BarResizing event - Occurs when a bar is moving or resizing.
Private Sub AxG2antt1_BarResizing(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_BarResizingEvent) Handles AxG2antt1.BarResizing
With AxG2antt1
Debug.Print( "Start" )
Debug.Print( e.key )
Debug.Print( .Items.ItemBar(e.item,e.key,EXG2ANTTLib.ItemBarPropertyEnum.exBarStartStr) )
Debug.Print( "End" )
Debug.Print( e.key )
Debug.Print( .Items.ItemBar(e.item,e.key,EXG2ANTTLib.ItemBarPropertyEnum.exBarEndStr) )
End With
End Sub
With AxG2antt1
.BeginUpdate()
.Columns.Add("Tasks")
.Debug = True
With .Chart
.FirstVisibleDate = #9/20/2006#
.LevelCount = 2
.PaneWidth(False) = 96
.ResizeUnitScale = EXG2ANTTLib.UnitEnum.exMinute
End With
With .Items
.AddBar(.AddItem("Task 1"),"Task",#9/21/2006#,#9/24/2006#,"K1")
.AddBar(.AddItem("Task 2"),"Task",#9/22/2006#,#9/25/2006#,"K2")
.AddBar(.AddItem("Task 3"),"Task",#9/23/2006#,#9/26/2006#,"K3")
End With
.EndUpdate()
End With
|
2336
|
How can I convert the exBarStart/exBarEnd property to a string (by default it returns as VARIANT/VT_DATE type, method 2)

' BarResizing event - Occurs when a bar is moving or resizing.
Private Sub AxG2antt1_BarResizing(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_BarResizingEvent) Handles AxG2antt1.BarResizing
With AxG2antt1
Debug.Print( "Start" )
Debug.Print( e.key )
Debug.Print( .FormatABC("dateF(value)",.Items.ItemBar(e.item,e.key,EXG2ANTTLib.ItemBarPropertyEnum.exBarStart)) )
Debug.Print( "End" )
Debug.Print( e.key )
Debug.Print( .FormatABC("dateF(value)",.Items.ItemBar(e.item,e.key,EXG2ANTTLib.ItemBarPropertyEnum.exBarEnd)) )
End With
End Sub
With AxG2antt1
.BeginUpdate()
.Columns.Add("Tasks")
.Debug = True
With .Chart
.FirstVisibleDate = #9/20/2006#
.LevelCount = 2
.PaneWidth(False) = 96
.ResizeUnitScale = EXG2ANTTLib.UnitEnum.exMinute
End With
With .Items
.AddBar(.AddItem("Task 1"),"Task",#9/21/2006#,#9/24/2006#,"K1")
.AddBar(.AddItem("Task 2"),"Task",#9/22/2006#,#9/25/2006#,"K2")
.AddBar(.AddItem("Task 3"),"Task",#9/23/2006#,#9/26/2006#,"K3")
End With
.EndUpdate()
End With
|
2335
|
How can I convert the exBarStart/exBarEnd property to a string (by default it returns as VARIANT/VT_DATE type, method 1)

' BarResizing event - Occurs when a bar is moving or resizing.
Private Sub AxG2antt1_BarResizing(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_BarResizingEvent) Handles AxG2antt1.BarResizing
With AxG2antt1
Debug.Print( "Start" )
Debug.Print( e.key )
Debug.Print( .FormatABC("date(value) format `MM/dd/yyyy HH:mm:ss`",.Items.ItemBar(e.item,e.key,EXG2ANTTLib.ItemBarPropertyEnum.exBarStart)) )
Debug.Print( "End" )
Debug.Print( e.key )
Debug.Print( .FormatABC("date(value) format `MM/dd/yyyy HH:mm:ss`",.Items.ItemBar(e.item,e.key,EXG2ANTTLib.ItemBarPropertyEnum.exBarEnd)) )
End With
End Sub
With AxG2antt1
.BeginUpdate()
.Columns.Add("Tasks")
.Debug = True
With .Chart
.FirstVisibleDate = #9/20/2006#
.LevelCount = 2
.PaneWidth(False) = 96
.ResizeUnitScale = EXG2ANTTLib.UnitEnum.exMinute
End With
With .Items
.AddBar(.AddItem("Task 1"),"Task",#9/21/2006#,#9/24/2006#,"K1")
.AddBar(.AddItem("Task 2"),"Task",#9/22/2006#,#9/25/2006#,"K2")
.AddBar(.AddItem("Task 3"),"Task",#9/23/2006#,#9/26/2006#,"K3")
End With
.EndUpdate()
End With
|
2334
|
Add/Remove/Updates the item-bar's resources

' Click event - Occurs when the user presses and then releases the left mouse button over the tree control.
Private Sub AxG2antt1_ClickEvent(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxG2antt1.ClickEvent
Dim h
With AxG2antt1
With .Items
h = .SelectedItem(0)
.ItemBar(h,.FirstItemBar(h),EXG2ANTTLib.ItemBarPropertyEnum.exBarResources) = "+R4[10%]"
End With
End With
End Sub
Dim h
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
With .Chart
.PaneWidth(False) = 96
.LevelCount = 2
.FirstVisibleDate = #1/1/2001#
With .Bars.Item("Task")
.Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption) = 18
.Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption) = "<%=%49%>"
End With
End With
.Columns.Add("Machines")
With .Items
h = .AddItem("Machine 1")
.AddBar(h,"Task",#1/6/2001#,#1/12/2001#,"K1")
.ItemBar(h,"K1",EXG2ANTTLib.ItemBarPropertyEnum.exBarResources) = "R1,R2"
h = .AddItem("Machine 2")
.AddBar(h,"Task",#1/4/2001#,#1/14/2001#,"K2")
.ItemBar(h,"K2",EXG2ANTTLib.ItemBarPropertyEnum.exBarResources) = "R2[75%],R3"
End With
.EndUpdate()
End With
|
2333
|
Distributes resources to a bar

Dim h
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
With .Chart
.PaneWidth(False) = 96
.LevelCount = 2
.FirstVisibleDate = #1/1/2001#
With .Bars.Item("Task")
.Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarHAlignCaption) = 18
.Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarCaption) = "<%=%49%>"
End With
End With
.Columns.Add("Machines")
With .Items
h = .AddItem("Machine 1")
.AddBar(h,"Task",#1/6/2001#,#1/12/2001#,"K1")
.ItemBar(h,"K1",EXG2ANTTLib.ItemBarPropertyEnum.exBarResources) = "R1,R2"
h = .AddItem("Machine 2")
.AddBar(h,"Task",#1/4/2001#,#1/14/2001#,"K2")
.ItemBar(h,"K2",EXG2ANTTLib.ItemBarPropertyEnum.exBarResources) = "R2[75%],R3"
End With
.EndUpdate()
End With
|
2332
|
How can I display additional information about a time zone when the user clicks on it (expandable)

With AxG2antt1
With .Chart
.PaneWidth(False) = 0
.LevelCount = 2
.FirstVisibleDate = #12/20/2009#
.MarkTimeZone("TZ",#1/1/2010#,#1/3/2010#,65280,"1;;<c>TimeZone<b><off -4><a ;exp=just more info about>*</a></b>;1")
End With
End With
|
2331
|
How can I have a tooltip for a marked TimeZone

' MouseMove event - Occurs when the user moves the mouse.
Private Sub AxG2antt1_MouseMoveEvent(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_MouseMoveEvent) Handles AxG2antt1.MouseMoveEvent
With AxG2antt1
.ShowToolTip(.Chart.TimeZoneFromPoint(-1,-1),"",Nothing,"+8")
End With
End Sub
With AxG2antt1
With .Chart
.PaneWidth(False) = 0
.LevelCount = 2
.FirstVisibleDate = #12/28/2009#
.MarkTimeZone("Top",#1/1/2010#,#1/5/2010#,16711680,"1;;<fgcolor=FFFFFF>Top;1")
.MarkTimeZone("Partial",#1/8/2010#,#1/12/2010#,16711680,"50;;<fgcolor=FFFFFF>Partial;1")
.MarkTimeZone("Default",#1/15/2010#,#1/19/2010#,16711680,";;<fgcolor=FFFFFF>Default;1")
End With
End With
|
2330
|
Can I set a filter that automatically adds a * before and after the word, so the user can just search for 'cat' and it becomes '*cat*' automatically

Dim h
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
With .Columns.Add("Items")
.DisplayFilterButton = True
.DisplayFilterPattern = True
.Def(EXG2ANTTLib.DefColumnEnum.exFilterPatternTemplate) = "*<%filter%>*"
.FilterType = EXG2ANTTLib.FilterTypeEnum.exPattern
.Filter = "1"
End With
With .Items
h = .AddItem("Root 1")
.InsertItem(h,Nothing,"Child 1")
.InsertItem(h,Nothing,"Child 2")
.ExpandItem(h) = True
h = .AddItem("Root 2")
.InsertItem(h,Nothing,"Child 1")
.InsertItem(h,Nothing,"Child 2")
End With
.ApplyFilter()
.EndUpdate()
End With
|
2329
|
The fine dotted lines in the control appear much thicker than the standard ones we've been using. How can we fix this

With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exAllLines
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesGeometric
With .Chart
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesGeometric
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exAllLines
End With
.ColumnAutoResize = False
.Columns.Add("Column 1")
.Columns.Add("Column 2")
.Columns.Add("Column 3")
.Columns.Add("Column 4")
.EndUpdate()
End With
|
2328
|
Load data as a tree using a parent-id relationship

Dim rs
With AxG2antt1
.BeginUpdate()
.ColumnAutoResize = False
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exVLines
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
rs = CreateObject("ADODB.Recordset")
With rs
.Open("Select * FROM Employees WHERE 1=0","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.mdb",3,3)
End With
.DataSource = rs
.Columns.Item(0).Width = 128
rs = CreateObject("ADODB.Recordset")
With rs
.Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.mdb",3,3)
End With
.PutItems(rs.GetRows(),";0;17")
.Items.ExpandItem(0) = True
.EndUpdate()
End With
|
2327
|
Is there a way to change the contents of the drop down editor based on a value in another column

' AddItem event - Occurs after a new Item has been inserted to Items collection.
Private Sub AxG2antt1_AddItem(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_AddItemEvent) Handles AxG2antt1.AddItem
With AxG2antt1
.Items.CellEditorVisible(e.item,0) = EXG2ANTTLib.EditorVisibleEnum.exEditorVisible
.Items.CellEditorVisible(e.item,1) = EXG2ANTTLib.EditorVisibleEnum.exEditorVisible
End With
End Sub
' EditOpen event - Occurs when the edit operation starts.
Private Sub AxG2antt1_EditOpen(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxG2antt1.EditOpen
Dim c,v
With AxG2antt1
With .Items
v = .CellValue(.FocusItem,0)
c = .CellCaption(.FocusItem,0)
End With
With .Columns.Item(1).Editor
.ClearItems()
.AddItem(v,c)
End With
End With
End Sub
Dim h
With AxG2antt1
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesGeometric
With .Columns.Add("DropDownList")
With .Editor
.EditType = EXG2ANTTLib.EditTypeEnum.DropDownListType
.AddItem(1,"First")
.AddItem(2,"Second")
.AddItem(3,"Third")
End With
End With
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exAllLines
.Columns.Add("DropDownList-Related").Editor.EditType = EXG2ANTTLib.EditTypeEnum.DropDownListType
With .Items
.CellValue(.AddItem(1),1) = -1
.CellValue(.AddItem(2),1) = -1
.CellValue(.AddItem(3),1) = -1
.LockedItemCount(EXG2ANTTLib.VAlignmentEnum.exBottom) = 1
h = .LockedItem(EXG2ANTTLib.VAlignmentEnum.exBottom,0)
.ItemDivider(h) = 0
.ItemDividerLineAlignment(h) = EXG2ANTTLib.DividerAlignmentEnum.DividerTop
.CellEditorVisible(h,0) = EXG2ANTTLib.EditorVisibleEnum.exEditorHidden
.CellSingleLine(h,0) = EXG2ANTTLib.CellSingleLineEnum.exCaptionWordWrap
.CellValueFormat(h,0) = EXG2ANTTLib.ValueFormatEnum.exHTML
.CellValue(h,0) = "The drop down editor in the second column is filled during the <b>EditOpen event</b>, and the values are based on the selection" & _
" on the first column."
End With
.EndUpdate()
End With
|
2326
|
Highlight the editable fields

' Change event - Occurs when the user changes the cell's content.
Private Sub AxG2antt1_Change(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_ChangeEvent) Handles AxG2antt1.Change
With AxG2antt1
.Refresh()
End With
End Sub
Dim g1,g2,h,r
With AxG2antt1
.FreezeEvents(True)
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
With .ConditionalFormats
With .Add("%CE1")
.Bold = True
.BackColor = RGB(245,245,245)
.ApplyTo = &H1
End With
With .Add("%CE2")
.Bold = True
.BackColor = RGB(245,245,245)
.ApplyTo = &H2
End With
With .Add("%CE3")
.Bold = True
.BackColor = RGB(245,245,245)
.ApplyTo = &H3
End With
End With
With .Columns
.Add("Description")
With .Add("Qty")
.Editor.EditType = EXG2ANTTLib.EditTypeEnum.SpinType
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
End With
With .Add("Price")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "avg(current,rec,%2)"
.Editor.EditType = EXG2ANTTLib.EditTypeEnum.SpinType
End With
With .Add("Amount")
.ComputedField = "%1 * %2"
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%3)"
End With
End With
With .Items
r = .AddItem("Root")
g1 = .InsertItem(r,Nothing,"Group 1")
h = .InsertItem(g1,Nothing,"Item 1")
.CellValue(h,1) = 1
.CellValue(h,2) = 10
h = .InsertItem(g1,Nothing,"Item 2")
.CellValue(h,1) = 2
.CellValue(h,2) = 11
g2 = .InsertItem(r,Nothing,"Group 2")
h = .InsertItem(g2,Nothing,"Item 1")
.CellValue(h,1) = 3
.CellValue(h,2) = 12
h = .InsertItem(g2,Nothing,"Item 2")
.CellValue(h,1) = 4
.CellValue(h,2) = 13
.ExpandItem(0) = True
End With
.EndUpdate()
.FreezeEvents(False)
End With
|
2325
|
Highlight the total fields

' Change event - Occurs when the user changes the cell's content.
Private Sub AxG2antt1_Change(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_ChangeEvent) Handles AxG2antt1.Change
With AxG2antt1
.Refresh()
End With
End Sub
Dim g1,g2,h,r
With AxG2antt1
.FreezeEvents(True)
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
With .ConditionalFormats
With .Add("%CT1")
.ForeColor = RGB(128,128,128)
.ApplyTo = &H1
End With
With .Add("%CT2")
.ForeColor = RGB(128,128,128)
.ApplyTo = &H2
End With
With .Add("%CT3")
.ForeColor = RGB(128,128,128)
.ApplyTo = &H3
End With
End With
With .Columns
.Add("Description")
With .Add("Qty")
.Editor.EditType = EXG2ANTTLib.EditTypeEnum.SpinType
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
End With
With .Add("Price")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "avg(current,rec,%2)"
.Editor.EditType = EXG2ANTTLib.EditTypeEnum.SpinType
End With
With .Add("Amount")
.ComputedField = "%1 * %2"
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%3)"
End With
End With
With .Items
r = .AddItem("Root")
g1 = .InsertItem(r,Nothing,"Group 1")
h = .InsertItem(g1,Nothing,"Item 1")
.CellValue(h,1) = 1
.CellValue(h,2) = 10
h = .InsertItem(g1,Nothing,"Item 2")
.CellValue(h,1) = 2
.CellValue(h,2) = 11
g2 = .InsertItem(r,Nothing,"Group 2")
h = .InsertItem(g2,Nothing,"Item 1")
.CellValue(h,1) = 3
.CellValue(h,2) = 12
h = .InsertItem(g2,Nothing,"Item 2")
.CellValue(h,1) = 4
.CellValue(h,2) = 13
.ExpandItem(0) = True
End With
.EndUpdate()
.FreezeEvents(False)
End With
|
2324
|
Highlight the leaf items

Dim h,hR
With AxG2antt1
.BeginUpdate()
.ConditionalFormats.Add("%CC0=0").ForeColor = RGB(128,128,128)
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
With .Columns
.Add("Item").Width = 16
.Add("Desc")
End With
With .Items
hR = .AddItem("Root")
.CellValue(hR,1) = "The root directory /"
.ExpandItem(hR) = True
h = .InsertItem(hR,Nothing,"Home")
.CellValue(h,1) = "The home directory with user directories Alice and Bob"
.InsertItem(h,Nothing,"Alice")
.InsertItem(h,Nothing,"Bob")
.ExpandItem(h) = True
h = .InsertItem(hR,Nothing,"Etc")
.CellValue(h,1) = "The etc directory with one configuration file"
h = .InsertItem(h,Nothing,"nginx.conf")
.CellValue(.InsertItem(hR,Nothing,"Var"),1) = "The var directory"
End With
.EndUpdate()
End With
|
2323
|
Highlight the parent items

Dim h,hR
With AxG2antt1
.BeginUpdate()
.ConditionalFormats.Add("%CC0").ForeColor = RGB(255,0,0)
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
With .Columns
.Add("Item").Width = 16
.Add("Desc")
End With
With .Items
hR = .AddItem("Root")
.CellValue(hR,1) = "The root directory /"
.ExpandItem(hR) = True
h = .InsertItem(hR,Nothing,"Home")
.CellValue(h,1) = "The home directory with user directories Alice and Bob"
.InsertItem(h,Nothing,"Alice")
.InsertItem(h,Nothing,"Bob")
.ExpandItem(h) = True
h = .InsertItem(hR,Nothing,"Etc")
.CellValue(h,1) = "The etc directory with one configuration file"
h = .InsertItem(h,Nothing,"nginx.conf")
.CellValue(.InsertItem(hR,Nothing,"Var"),1) = "The var directory"
End With
.EndUpdate()
End With
|
2322
|
Highlight the item being expanded or collapsed

Dim h,hR
With AxG2antt1
.BeginUpdate()
.ConditionalFormats.Add("%CX0").Bold = True
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
With .Columns
.Add("Item").Width = 16
.Add("Desc")
End With
With .Items
hR = .AddItem("Root")
.CellValue(hR,1) = "The root directory /"
.ExpandItem(hR) = True
h = .InsertItem(hR,Nothing,"Home")
.CellValue(h,1) = "The home directory with user directories Alice and Bob"
.InsertItem(h,Nothing,"Alice")
.InsertItem(h,Nothing,"Bob")
.ExpandItem(h) = True
h = .InsertItem(hR,Nothing,"Etc")
.CellValue(h,1) = "The etc directory with one configuration file"
h = .InsertItem(h,Nothing,"nginx.conf")
.CellValue(.InsertItem(hR,Nothing,"Var"),1) = "The var directory"
End With
.EndUpdate()
End With
|
2321
|
I am using exTotalColumn. Is there an option to exclude specific cells to display the total

' Change event - Occurs when the user changes the cell's content.
Private Sub AxG2antt1_Change(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_ChangeEvent) Handles AxG2antt1.Change
With AxG2antt1
.Refresh()
End With
End Sub
Dim g1,g2,h,r
With AxG2antt1
.FreezeEvents(True)
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
With .Columns
.Add("Description")
With .Add("Qty")
.Editor.EditType = EXG2ANTTLib.EditTypeEnum.SpinType
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
End With
With .Add("Price")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "avg(current,rec,%2)"
.Editor.EditType = EXG2ANTTLib.EditTypeEnum.SpinType
End With
With .Add("Amount")
.ComputedField = "%1 * %2"
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%3)"
End With
End With
With .Items
r = .AddItem("Root")
g1 = .InsertItem(r,Nothing,"Group 1")
.FormatCell(g1,2) = "`<average missing>`"
.CellEditorVisible(g1,2) = EXG2ANTTLib.EditorVisibleEnum.exEditorHidden
.CellBold(g1,2) = True
.CellForeColor(g1,2) = RGB(255,0,0)
h = .InsertItem(g1,Nothing,"Item 1")
.CellValue(h,1) = 1
.CellValue(h,2) = 10
h = .InsertItem(g1,Nothing,"Item 2")
.CellValue(h,1) = 2
.CellValue(h,2) = 11
g2 = .InsertItem(r,Nothing,"Group 2")
h = .InsertItem(g2,Nothing,"Item 1")
.CellValue(h,1) = 3
.CellValue(h,2) = 12
h = .InsertItem(g2,Nothing,"Item 2")
.CellValue(h,1) = 4
.CellValue(h,2) = 13
.ExpandItem(0) = True
End With
.EndUpdate()
.FreezeEvents(False)
End With
|
2320
|
How can I add a total column

' Change event - Occurs when the user changes the cell's content.
Private Sub AxG2antt1_Change(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_ChangeEvent) Handles AxG2antt1.Change
With AxG2antt1
.Refresh()
End With
End Sub
Dim g1,g2,h,r
With AxG2antt1
.FreezeEvents(True)
.BeginUpdate()
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.HeaderHeight = 24
.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
With .Columns
.Add("Description")
With .Add("Qty")
.Editor.EditType = EXG2ANTTLib.EditTypeEnum.SpinType
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%1)"
End With
With .Add("Price")
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "avg(current,rec,%2)"
.Editor.EditType = EXG2ANTTLib.EditTypeEnum.SpinType
End With
With .Add("Amount")
.ComputedField = "%1 * %2"
.Def(EXG2ANTTLib.DefColumnEnum.exTotalColumn) = "sum(current,rec,%3)"
End With
End With
With .Items
r = .AddItem("Root")
g1 = .InsertItem(r,Nothing,"Group 1")
h = .InsertItem(g1,Nothing,"Item 1")
.CellValue(h,1) = 1
.CellValue(h,2) = 10
h = .InsertItem(g1,Nothing,"Item 2")
.CellValue(h,1) = 2
.CellValue(h,2) = 11
g2 = .InsertItem(r,Nothing,"Group 2")
h = .InsertItem(g2,Nothing,"Item 1")
.CellValue(h,1) = 3
.CellValue(h,2) = 12
h = .InsertItem(g2,Nothing,"Item 2")
.CellValue(h,1) = 4
.CellValue(h,2) = 13
.ExpandItem(0) = True
End With
.EndUpdate()
.FreezeEvents(False)
End With
|
2319
|
Is it possible when I move the horizontal scroll bar, that the whole chart scrolls live during move the horizontal scroll bar. Not it scrolls just when I release the left mouse, not during change the horizontal scroll position
With AxG2antt1
With .Chart
.PaneWidth(False) = 0
.LevelCount = 2
.ToolTip = ""
End With
End With
|
2318
|
The exLinkStyle is not valid (the style of the link is still solid) if the link's width is greater than 1. What can be done
Dim h1,h2,h3
With AxG2antt1
.BeginUpdate()
.Columns.Add("Task")
With .Chart
.FirstVisibleDate = #1/1/2001#
.PaneWidth(False) = 128
End With
.AntiAliasing = True
With .Items
h1 = .AddItem("Task 1")
.AddBar(h1,"Task",#1/2/2001#,#1/4/2001#,"K1")
h2 = .AddItem("Task 2")
.AddBar(h2,"Task",#1/5/2001#,#1/7/2001#,"K2")
.AddLink("L1",h1,"K1",h2,"K2")
.Link("L1",EXG2ANTTLib.LinkPropertyEnum.exLinkStyle) = 2
.Link("L1",EXG2ANTTLib.LinkPropertyEnum.exLinkWidth) = 2
h3 = .AddItem("Task 4")
.AddBar(h3,"Task",#1/8/2001#,#1/10/2001#,"K3")
.AddLink("L2",h2,"K2",h3,"K3")
.Link("L2",EXG2ANTTLib.LinkPropertyEnum.exLinkStyle) = 1
.Link("L2",EXG2ANTTLib.LinkPropertyEnum.exLinkWidth) = 2
End With
.EndUpdate()
End With
|
2317
|
How can I change the tooltip's margins (method 2)

' MouseMove event - Occurs when the user moves the mouse.
Private Sub AxG2antt1_MouseMoveEvent(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_MouseMoveEvent) Handles AxG2antt1.MouseMoveEvent
With AxG2antt1
.ShowToolTip(.Chart.BarFromPoint(-1,-1))
End With
End Sub
Dim h
With AxG2antt1
.BeginUpdate()
.ToolTipMargin = "16,8"
.Columns.Add("Def")
With .Chart
.AllowCreateBar = EXG2ANTTLib.CreateBarEnum.exNoCreateBar
.PaneWidth(False) = 64
.LevelCount = 2
.FirstVisibleDate = #1/1/2010#
.Bars.Item("Task").Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip) = "..."
End With
With .Items
h = .AddItem("Task")
.AddBar(h,"Task",#1/2/2010#,#1/5/2010#,"A","A")
.AddBar(h,"Task",#1/5/2010#,#1/8/2010#,"B","B")
End With
.EndUpdate()
End With
|
2316
|
Are there any properties to set text margins at tooltip, like Margins="5,5" (method 1). Margins is used to get some space between text and the tooltips border

' MouseMove event - Occurs when the user moves the mouse.
Private Sub AxG2antt1_MouseMoveEvent(ByVal sender As System.Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_MouseMoveEvent) Handles AxG2antt1.MouseMoveEvent
With AxG2antt1
.ShowToolTip(.Chart.BarFromPoint(-1,-1))
End With
End Sub
Dim h
With AxG2antt1
.BeginUpdate()
.ToolTipMargin = "16,8"
.Columns.Add("Def")
With .Chart
.AllowCreateBar = EXG2ANTTLib.CreateBarEnum.exNoCreateBar
.PaneWidth(False) = 64
.LevelCount = 2
.FirstVisibleDate = #1/1/2010#
.Bars.Item("Task").Def(EXG2ANTTLib.ItemBarPropertyEnum.exBarToolTip) = "..."
End With
With .Items
h = .AddItem("Task")
.AddBar(h,"Task",#1/2/2010#,#1/5/2010#,"A","A")
.AddBar(h,"Task",#1/5/2010#,#1/8/2010#,"B","B")
End With
.EndUpdate()
End With
|
2315
|
exShowExtendedLinks

With AxG2antt1
.BeginUpdate()
.DefaultItemHeight = 24
.HeaderHeight = 20
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.AntiAliasing = True
.Columns.Add("Task")
With .Chart
.PaneWidth(False) = 48
.LevelCount = 2
.UnitScale = EXG2ANTTLib.UnitEnum.exHour
.FirstVisibleDate = #1/10/2024#
With .Level(1)
.DrawTickLines = EXG2ANTTLib.LevelLineEnum.exLevelNoLine
.DrawTickLinesFrom(0,EXG2ANTTLib.LevelLineEnum.exLevelDotLine)
End With
.AllowResizeChart = &Hfffffef9 Or EXG2ANTTLib.ResizeChartEnum.exAllowChangeUnitScale Or EXG2ANTTLib.ResizeChartEnum.exAllowResizeChartMiddle Or EXG2ANTTLib.ResizeChartEnum.exAllowResizeChartHeader
.ShowLinks = EXG2ANTTLib.ShowExtendedLinksEnum.exShowExtendedLinks
End With
With .Items
.AddBar(.AddItem("T1"),"Task",#1/10/2024 10:00:00 AM#,#1/10/2024 10:20:00 AM#,"T1")
.AddBar(.AddItem("T2"),"Task",#1/10/2024 9:00:00 AM#,#1/10/2024 0:00:00 PM#,"T2")
.AddBar(.AddItem("T3"),"Task",#1/10/2024 8:00:00 AM#,#1/10/2024 8:30:00 AM#,"T3")
.AddBar(.AddItem("T4"),"Task",#1/10/2024 8:00:00 AM#,#1/10/2024 8:30:00 AM#,"T4")
.AddLink("L13",.ItemByIndex(0),"T1",.ItemByIndex(2),"T3")
.AddLink("L14",.ItemByIndex(0),"T1",.ItemByIndex(3),"T4")
.AddLink("L24",.ItemByIndex(1),"T2",.ItemByIndex(3),"T4")
End With
.EndUpdate()
End With
|
2314
|
According to the documentation of the ShowExtendedLinksEnum value exShowExtendedLinks (1) it is possible to distinctly visualise links (rather than showing them one over another) when two or more links start or end on the same bar

With AxG2antt1
.BeginUpdate()
.DefaultItemHeight = 24
.HeaderHeight = 20
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.AntiAliasing = True
.Columns.Add("Task")
With .Chart
.PaneWidth(False) = 48
.LevelCount = 2
.UnitScale = EXG2ANTTLib.UnitEnum.exHour
.FirstVisibleDate = #1/10/2024#
With .Level(1)
.DrawTickLines = EXG2ANTTLib.LevelLineEnum.exLevelNoLine
.DrawTickLinesFrom(0,EXG2ANTTLib.LevelLineEnum.exLevelDotLine)
End With
.AllowResizeChart = &Hfffffef9 Or EXG2ANTTLib.ResizeChartEnum.exAllowChangeUnitScale Or EXG2ANTTLib.ResizeChartEnum.exAllowResizeChartMiddle Or EXG2ANTTLib.ResizeChartEnum.exAllowResizeChartHeader
End With
With .Items
.AddBar(.AddItem("T1"),"Task",#1/10/2024 10:00:00 AM#,#1/10/2024 10:20:00 AM#,"T1")
.AddBar(.AddItem("T2"),"Task",#1/10/2024 9:00:00 AM#,#1/10/2024 0:00:00 PM#,"T2")
.AddBar(.AddItem("T3"),"Task",#1/10/2024 8:00:00 AM#,#1/10/2024 8:30:00 AM#,"T3")
.AddBar(.AddItem("T4"),"Task",#1/10/2024 8:00:00 AM#,#1/10/2024 8:30:00 AM#,"T4")
.AddLink("L1",.ItemByIndex(0),"T1",.ItemByIndex(2),"T3")
.AddLink("L2",.ItemByIndex(1),"T2",.ItemByIndex(3),"T4")
.Link("L2",EXG2ANTTLib.LinkPropertyEnum.exLinkShowRound) = 4
End With
.EndUpdate()
End With
|
2313
|
How to use arrows key left/right to move the cursor left/right inside the text
With AxG2antt1
.BeginUpdate()
With .Columns.Add("Edit").Editor
.EditType = EXG2ANTTLib.EditTypeEnum.EditType
.Option(EXG2ANTTLib.EditorOptionEnum.exLeftArrow) = False
.Option(EXG2ANTTLib.EditorOptionEnum.exRightArrow) = False
End With
With .Items
.AddItem("000")
.AddItem("111")
.AddItem("222")
End With
.EndUpdate()
End With
|
2312
|
How can I force the cursor to jump to the end of the editor once the user clicks the cell
With AxG2antt1
.BeginUpdate()
.SelBackColor = .BackColor
.SelForeColor = .ForeColor
With .Columns.Add("Edit").Editor
.EditType = EXG2ANTTLib.EditTypeEnum.EditType
.Option(EXG2ANTTLib.EditorOptionEnum.exEditSelStart) = -1
End With
With .Items
.AddItem("000")
.AddItem("111")
.AddItem("222")
End With
.EndUpdate()
End With
|
2311
|
How can I show the overview with a different color except or outside the selection

With AxG2antt1
.BeginUpdate()
.VisualAppearance.Add(1,"gBFLBCJwBAEHhEJAAEhABVIDg6AADACAxRDAMgBQKAAzAJBIYhiGgcYCgMZBSDeCYXABCEYRXBIZQ7BKNIxjSJwFgmEgADE2YAoJDUN4nDKMMDybBkRxtDCPIDnGQoD" & _
"iGI4nSbKIzSCKMQhrEKZZrnaLJFgOTY8ABLEBvfSgASof6MKBlKhKGoiUo2SCFEaBTBNHxDL6raqqWJ5HDINQlWzbcjjKKFYRbOqTZDkGj4XqKTo3YBAdZSXJsXwTGKk" & _
"ji3ZgMOR3HaQaTjOgINpuDZdRzkUYZUDFSwSDqQIRtCpbJqzFZDZbLNbYBYME47AayID0CbdCgmaalSZHNxbVa0BzpXrFLw1TLoDy8AJ+ABseKzfo9PxdIygZRzKJ8ao" & _
"fE+YxynIfJcC8QgbCmL5eiEPIKH6RABlibJpicW4/FcAx/HOYRGmud4+CcHxdmiDhkGEIIIEkQJSGMHQHFGSBlFEUITEmewAAQIQ2AYRpDGQJAoEIXhXCkCB5kmSAdmg" & _
"VZPmgZJ8gaT4oHSeIHk8aIEnWCJiEiFgmgmYoIiYJIIE8aB8niB0pmyfIGE+ZYmDQPpjgOUg6DqY5DgYPg2mQAxqEKEJkEkFhGhGZIJA4QA2mOY4GDwOsumCe4NAACJK" & _
"DoPQOFkZJThaSoZHSGYXmYCYGGKGJmEmFhmCsJoDFYag5iaSISDIAAjAkPJLhyS4JlYbA5iSeZmHqHpnkmdh+hOZx5lSOAzGgSQ+DAAAimkNIkiKTh6DSbIjmkChGhKJ" & _
"JpEoVoWiSaJThyKImmSWI4ACCwNkqBhgDsahKhaJopmqComiqKpqkqEhghKYpAAIJIQmYA46jaLZrgqZo6i6a5KnaPotiZRQkiyIg6lIXw7myCwmkqMpsksNpOjObQLC" & _
"KQYQiwOpOEKGAPAsZpajabZLHaXo3m4C4GlmNJNisVpFjWZZzkaao6m6S42m6O5vAuRpyjqLhLhidYxgmE5KnqPpvkudp+j+cAMAcAo+i8WIOkSPZuguZwDkKcJMDafp" & _
"BE8XAengPJxEwVwWkWcYMGcGpGnGTBTBCRIwhkXwikichMhcJpJnKDIPB+NYNimAgqkucwMkcMoInKO4fC2F5ikyZw6k6c5MncPpPnOLJXAiTZJhOXxGlGdINCcSpSnS" & _
"TQ3E6UY0CuYgulSdRNFcVpVnWDRnFSVBwh0axeledgNFsXJRA+HYXGaWZ2g2JxqlqdpNjcZZYmYCJDHKXJ3E2K4doux3gbE8OEF4ygtjuH6L8eAHAHgFGCO8bY2QZgZD" & _
"iBwJ4FRijxE4G8DoxBxj6B6EINwTADjvBaMseYHBng1GaPMTg7wepxA4J4Rx8RjgfCYFMeoEQ6BpGqPUTob2MD2A6IQLoNAKiHAuG0WYAAJCVBCCETAHR3DMFWPgDwD2" & _
"9j4E8CoV4sw7imAIIcJASggAHBeBIJw5grikCmHoSYNxWjrH2BMAoNgqAZE8O0GYEg5DgAIG8DgxwjhXGaCYZIcgnxBGSDILgmwTjKHkJMNwqgjCREoGEC4RRMifHqJc" & _
"YokQ6BgEYJEUIaQOhlHIIESAECAg=")
.BackColorLevelHeader = .BackColor
.set_Background(EXG2ANTTLib.BackgroundPartEnum.exOverviewSelResize,1)
.set_Background(EXG2ANTTLib.BackgroundPartEnum.exOverviewSelOut,15790320)
.Chart.OverviewSelBackColor = RGB(255,255,255)
.set_Background(EXG2ANTTLib.BackgroundPartEnum.exOverviewSelUnit,16777216)
With .Chart
.FirstVisibleDate = #6/21/2001#
.PaneWidth(False) = 48
.OverviewVisible = &H400 Or EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowSelMargins Or EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowMargins Or EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowDateTimeScaleBottom Or EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowAllVisible
.OverviewHeight = 64
.LevelCount = 2
.UnitScale = EXG2ANTTLib.UnitEnum.exDay
.Label(EXG2ANTTLib.UnitEnum.exHour) = ""
.Label(EXG2ANTTLib.UnitEnum.exMinute) = ""
.Label(EXG2ANTTLib.UnitEnum.exSecond) = ""
.AllowOverviewZoom = EXG2ANTTLib.OverviewZoomEnum.exAlwaysZoom
End With
.Columns.Add("Column")
With .Items
.AddBar(.AddItem("Item 1"),"Task",#1/2/2001#,#1/11/2001#)
.AddBar(.AddItem("Item 2"),"Task",#7/2/2001#,#7/11/2001#)
.AddBar(.AddItem("Item 3"),"Task",#11/2/2001#,#11/11/2001#)
End With
.EndUpdate()
End With
|
2310
|
Resize the chart using the overview's selection left and right margins (blue)

With AxG2antt1
.BeginUpdate()
.BackColorLevelHeader = .BackColor
.set_Background(EXG2ANTTLib.BackgroundPartEnum.exOverviewSelResize,16711680)
With .Chart
.FirstVisibleDate = #6/21/2001#
.PaneWidth(False) = 48
.OverviewVisible = &H400 Or EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowSelMargins Or EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowMargins Or EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowDateTimeScaleBottom Or EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowAllVisible
.OverviewHeight = 64
.LevelCount = 2
.UnitScale = EXG2ANTTLib.UnitEnum.exDay
End With
.Columns.Add("Column")
With .Items
.AddBar(.AddItem("Item 1"),"Task",#1/2/2001#,#1/11/2001#)
.AddBar(.AddItem("Item 2"),"Task",#7/2/2001#,#7/11/2001#)
.AddBar(.AddItem("Item 3"),"Task",#11/2/2001#,#11/11/2001#)
End With
.EndUpdate()
End With
|
2309
|
Resize the chart using the overview's selection left and right margins (black)

With AxG2antt1
.BeginUpdate()
.BackColorLevelHeader = .BackColor
.set_Background(EXG2ANTTLib.BackgroundPartEnum.exOverviewSelResize,1)
With .Chart
.FirstVisibleDate = #6/21/2001#
.PaneWidth(False) = 48
.OverviewVisible = &H400 Or EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowSelMargins Or EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowMargins Or EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowDateTimeScaleBottom Or EXG2ANTTLib.OverviewVisibleEnum.exOverviewShowAllVisible
.OverviewHeight = 64
.LevelCount = 2
.UnitScale = EXG2ANTTLib.UnitEnum.exDay
End With
.Columns.Add("Column")
With .Items
.AddBar(.AddItem("Item 1"),"Task",#1/2/2001#,#1/11/2001#)
.AddBar(.AddItem("Item 2"),"Task",#7/2/2001#,#7/11/2001#)
.AddBar(.AddItem("Item 3"),"Task",#11/2/2001#,#11/11/2001#)
End With
.EndUpdate()
End With
|
2308
|
Disable temporarily the column's sort, resize and drag and drop

With AxG2antt1
.BeginUpdate()
.OnResizeControl = EXG2ANTTLib.OnResizeControlEnum.exResizeChart
.SortBarVisible = True
.SortBarCaption = "<fgcolor 808080><c>the header and the sort-bar are disabled (no drag and drop is allowed)"
.AllowGroupBy = True
.HeaderEnabled = False
.HeaderAppearance = EXG2ANTTLib.AppearanceEnum.Etched
.Columns.Add("Index").FormatColumn = "1 index ``"
.Columns.Add("Pos").FormatColumn = "1 apos ``"
.Columns.Add("Edit").Editor.EditType = EXG2ANTTLib.EditTypeEnum.EditType
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesGeometric
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exVLines
.GridLineColor = RGB(224,224,224)
With .Chart
.AllowCreateBar = EXG2ANTTLib.CreateBarEnum.exCreateBarAuto
.LevelCount = 2
.FirstVisibleDate = #12/28/2000#
.PaneWidth(False) = 196
.GridLineStyle = EXG2ANTTLib.GridLinesStyleEnum.exGridLinesGeometric
.DrawGridLines = EXG2ANTTLib.GridLinesEnum.exAllLines
With .Level(1)
.DrawGridLines = True
.GridLineColor = AxG2antt1.GridLineColor
End With
End With
.EndUpdate()
End With
|
2307
|
Adds a Finish-Start(FS) link (method 3)

Dim h1,h2
With AxG2antt1
.BeginUpdate()
.Columns.Add("Name")
With .Chart
.LevelCount = 2
.FirstVisibleDate = #12/28/2000#
.PaneWidth(False) = 64
End With
With .Items
h1 = .AddItem("Item 1")
.AddBar(h1,"Task",#1/3/2001#,#1/6/2001#)
h2 = .AddItem("Item 2")
.AddBar(h2,"Task",#1/3/2001#,#1/6/2001#)
.AddLink("Link1",h1,"",h2,"")
.SchedulePDM(0,"")
End With
.EndUpdate()
End With
|
2306
|
Adds a Start-Start(SS) link (method 3)

Dim h1,h2
With AxG2antt1
.BeginUpdate()
.Columns.Add("Name")
With .Chart
.LevelCount = 2
.FirstVisibleDate = #12/28/2000#
.PaneWidth(False) = 64
End With
With .Items
h1 = .AddItem("Item 1")
.AddBar(h1,"Task",#1/3/2001#,#1/6/2001#)
h2 = .AddItem("Item 2")
.AddBar(h2,"Task",#1/3/2001#,#1/6/2001#)
.AddLink("Link1",h1,"",h2,"")
.Link("Link1",EXG2ANTTLib.LinkPropertyEnum.exLinkStartPos) = 0
.Link("Link1",EXG2ANTTLib.LinkPropertyEnum.exLinkEndPos) = 0
.SchedulePDM(0,"")
End With
.EndUpdate()
End With
|
2305
|
Adds a Finish-Finish(FF) link (method 3)

Dim h1,h2
With AxG2antt1
.BeginUpdate()
.Columns.Add("Name")
With .Chart
.LevelCount = 2
.FirstVisibleDate = #12/28/2000#
.PaneWidth(False) = 64
End With
With .Items
h1 = .AddItem("Item 1")
.AddBar(h1,"Task",#1/3/2001#,#1/6/2001#)
h2 = .AddItem("Item 2")
.AddBar(h2,"Task",#1/3/2001#,#1/6/2001#)
.AddLink("Link1",h1,"",h2,"")
.Link("Link1",EXG2ANTTLib.LinkPropertyEnum.exLinkStartPos) = 2
.Link("Link1",EXG2ANTTLib.LinkPropertyEnum.exLinkEndPos) = 2
.SchedulePDM(0,"")
End With
.EndUpdate()
End With
|
2304
|
Adds a Start-Finish(SF) link (method 3)

Dim h1,h2
With AxG2antt1
.BeginUpdate()
.Columns.Add("Name")
With .Chart
.LevelCount = 2
.FirstVisibleDate = #12/28/2000#
.PaneWidth(False) = 64
End With
With .Items
h1 = .AddItem("Item 1")
.AddBar(h1,"Task",#1/3/2001#,#1/6/2001#)
h2 = .AddItem("Item 2")
.AddBar(h2,"Task",#1/3/2001#,#1/6/2001#)
.AddLink("Link1",h1,"",h2,"")
.Link("Link1",EXG2ANTTLib.LinkPropertyEnum.exLinkStartPos) = 0
.Link("Link1",EXG2ANTTLib.LinkPropertyEnum.exLinkEndPos) = 2
.SchedulePDM(0,"")
End With
.EndUpdate()
End With
|
2303
|
Adds a Finish-Start(FS) link (method 2)

Dim h1,h2
With AxG2antt1
.BeginUpdate()
.Columns.Add("Name")
With .Chart
.LevelCount = 2
.FirstVisibleDate = #12/28/2000#
.PaneWidth(False) = 64
End With
With .Items
h1 = .AddItem("Item 1")
.AddBar(h1,"Task",#1/3/2001#,#1/6/2001#)
h2 = .AddItem("Item 2")
.AddBar(h2,"Task",#1/3/2001#,#1/6/2001#)
.ItemBar(h2,"",EXG2ANTTLib.ItemBarPropertyEnum.exBarPredecessor) = "1FS"
.SchedulePDM(0,"")
End With
.EndUpdate()
End With
|
2302
|
Adds a Start-Start(SS) link (method 2)

Dim h1,h2
With AxG2antt1
.BeginUpdate()
.Columns.Add("Name")
With .Chart
.LevelCount = 2
.FirstVisibleDate = #12/28/2000#
.PaneWidth(False) = 64
End With
With .Items
h1 = .AddItem("Item 1")
.AddBar(h1,"Task",#1/3/2001#,#1/6/2001#)
h2 = .AddItem("Item 2")
.AddBar(h2,"Task",#1/3/2001#,#1/6/2001#)
.ItemBar(h2,"",EXG2ANTTLib.ItemBarPropertyEnum.exBarPredecessor) = "1SS"
.SchedulePDM(0,"")
End With
.EndUpdate()
End With
|
2301
|
Adds a Finish-Finish(FF) link (method 2)

Dim h1,h2
With AxG2antt1
.BeginUpdate()
.Columns.Add("Name")
With .Chart
.LevelCount = 2
.FirstVisibleDate = #12/28/2000#
.PaneWidth(False) = 64
End With
With .Items
h1 = .AddItem("Item 1")
.AddBar(h1,"Task",#1/3/2001#,#1/6/2001#)
h2 = .AddItem("Item 2")
.AddBar(h2,"Task",#1/3/2001#,#1/6/2001#)
.ItemBar(h2,"",EXG2ANTTLib.ItemBarPropertyEnum.exBarPredecessor) = "1FF"
.SchedulePDM(0,"")
End With
.EndUpdate()
End With
|