| |

Public Sub SetVerticalLevelExample()
Dim objmilestones As Object, symboltext As String, datestring As String
Dim LastSymbolInLine As Integer
objmilestones = CreateObject("Milestones")
With objmilestones
.Activate
'add 11 bars on the same row, but on different vertical levels
.putcell(1, 1, "VerticalLevel2")
.putcell(2, 1, "VerticalLevel")
For nCounter = -5 To 5
symboltext = "level " + CStr(nCounter)
datestring = CStr(nCounter + 6) + "/01/2024"
.addtaskusingduration("1", datestring, 1, 1, 0, 2, "30", "day", 0, 0, symboltext, "", "")
LastSymbolInLine = .getnumberofsymbolsinline(1)
.setsymbolproperty(1, LastSymbolInLine - 1, "VerticalLevel2", nCounter)
.setsymbolproperty(1, LastSymbolInLine, "VerticalLevel2", nCounter)
Next nCounter
For nCounter = 1 To 3
symboltext = "level " + CStr(nCounter)
datestring = CStr(nCounter + 6) + "/01/2024"
.addtaskusingduration("2", datestring, 1, 1, 0, 2, "30", "day", 0, 0, symboltext, "", "")
LastSymbolInLine = .getnumberofsymbolsinline(2)
.setsymbolproperty(2, LastSymbolInLine - 1, "VerticalLevel", nCounter)
.setsymbolproperty(2, LastSymbolInLine, "VerticalLevel", nCounter)
Next nCounter
.SetStartAndEndDates("01/01/2024", "12/31/2024")
.setlinesperpage("3")
.Refresh
.Close
End With
End Sub
|