TimeLineScrollBar Start Date and End Date
Date:9/18/2012 11:38:00 PM
Product:ActiveGanttCSN Gantt Chart / Scheduler Component
Framework:.Net Framework 4.0 / Visual Studio 2010
User's Development Environment:C# Visual Studio 2010
Subject:Setting StartDate and EndDate with the TimeLineScrollBar

I have a question regarding the TimeLine.TimeLineScrollBar.Max parameter of the View object.

how I can set this value if I want to limit the amount of time shown in the Gantt chart just by using a start date and an end date?



In the most simple of ways you can calculate it using this function:

    private void SetTimeLineScrollBar(AGCSN.DateTime dtStartDate, AGCSN.DateTime dtEndDate)
        int lScreenDiff = 0;
        int lTotalDiff = 0;
        lScreenDiff = ActiveGanttCSNCtl1.MathLib.DateTimeDiff(ActiveGanttCSNCtl1.CurrentViewObject.TimeLine.TimeLineScrollBar.Interval, ActiveGanttCSNCtl1.CurrentViewObject.TimeLine.StartDate, ActiveGanttCSNCtl1.CurrentViewObject.TimeLine.EndDate);
        lTotalDiff = ActiveGanttCSNCtl1.MathLib.DateTimeDiff(ActiveGanttCSNCtl1.CurrentViewObject.TimeLine.TimeLineScrollBar.Interval, dtStartDate, dtEndDate);
        ActiveGanttCSNCtl1.CurrentViewObject.TimeLine.TimeLineScrollBar.Max = lTotalDiff - lScreenDiff;


This function will work in every technology/language version of ActiveGantt (VBN, CSN, VBW, VBE, etc).


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.