Example 16 - Set vertical levels

 

This example shows how to set the vertical level property for symbols.

 

 

 

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

To effectively program with this interface, it's important to learn all about Milestones Professional.  Learn about Milestones.

Milestones Professional 2025 Automation Methods and Properties.  © Copyright 2000-2025, KIDASA Software, Inc. All rights reserved.