The ProgressLine object in the Gantt Chart control
Details
Date:8/26/2011 2:31:09 PM
Product:ActiveGanttVC Gantt Chart / Scheduler Component
Framework:.Net Framework 4.0 / Visual Studio 2010
Version:2.8.5
User's Development Environment:Microsoft Visual C++ 8.0
Subject:Vertical Current Time Line
Question

I've downloaded your ActiveGanttVC samples and have tested them with much success. After running the samples and reading the developers online documentation, I don't see where you have a vertical line to indicate the current time or "today" marker.

Answer

Answer:

Every View object has an associated ProgressLine Object:

ActiveGanttVCCtl1.CurrentViewObject.TimeLine.ProgressLine

In order to display this ProgressLine object we've created a simple example in Visual Basic 6, creating an empty form and adding an instance of the Gantt Chart control called ActiveGanttVCCtl, it contains the following code:


Option Explicit

Private Sub Form_Load()
    Dim i As Long
    'These lines add a few rows to the control
    For i = 0 To 30
    ActiveGanttVCCtl1.Rows.Add "K" & i, "", True, True, ""
    Next i
    ActiveGanttVCCtl1.CurrentViewObject.TimeLine.ProgressLine.LineType = TLMT_SYSTEMTIME
End Sub

This will output the following result:

In it's default state the ProgressLine will be drawn in the TickMarkArea only in red using system time.

The ProgressLine can also be modified to include both the TickMarkArea and the ClientArea:


ActiveGanttVCCtl1.CurrentViewObject.TimeLine.ProgressLine.Length = TLMA_BOTH

And produce the following output:

Other options include:


    ActiveGanttVCCtl1.CurrentViewObject.TimeLine.ProgressLine.Length = TLMA_CLIENTAREA
    ActiveGanttVCCtl1.CurrentViewObject.TimeLine.ProgressLine.Length = TLMA_TICKMARKAREA
    ActiveGanttVCCtl1.CurrentViewObject.TimeLine.ProgressLine.Length = TLMA_NONE

Setting the Length to TLMA_NONE will not display the ProgressLine. Other ProgressLine properties can be modified to change the color (to blue in this example) and to set an arbitrary date other than the system's time (August 29th, 2011 2:00pm when the system's time is 11:38 AM):


    ActiveGanttVCCtl1.CurrentViewObject.TimeLine.ProgressLine.LineType = TLMT_USER
    ActiveGanttVCCtl1.CurrentViewObject.TimeLine.ProgressLine.Position = #8/29/2011 2:00:00 PM#
    ActiveGanttVCCtl1.CurrentViewObject.TimeLine.ProgressLine.Length = TLMA_BOTH
    ActiveGanttVCCtl1.CurrentViewObject.TimeLine.ProgressLine.ForeColor = CLR_BLUE

And this will produce the following output:

 

All trademarks are property of their respective holders, and are only used to directly describe the products and services being provided. Their use in no way indicates any relationship or endorsement between The Source Code Store LLC and the holders of said trademarks.