Type | Description | |||
Date as Variant | A Date expression that indicates the date being marked as nonworking day. |
The following VB sample marks the 11th of each month as nonworking day ( the code enumerates the visible dates, and marks one by one, if case ):
Private Sub Gantt1_DateChange() With Gantt1 .BeginUpdate With .Chart Dim d As Date d = .FirstVisibleDate Do While .IsDateVisible(d) If Day(d) = 11 Then If Not (.IsNonworkingDate(d)) Then .AddNonworkingDate d End If End If d = .NextDate(d, exDay, 1) Loop End With .EndUpdate End With End Sub
The following VB.NET sample marks the 11th of each month as nonworking day:
Private Sub AxGantt1_DateChange(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxGantt1.DateChange With AxGantt1 .BeginUpdate() With .Chart Dim d As Date = .FirstVisibleDate Do While .IsDateVisible(d) If d.Day = 11 Then If Not (.IsNonworkingDate(d)) Then .AddNonworkingDate(d) End If End If d = .NextDate(d, EXGANTTLib.UnitEnum.exDay, 1) Loop End With .EndUpdate() End With End Sub
The following C# sample marks the 11th of each month as nonworking day:
private void axGantt1_DateChange(object sender, EventArgs e) { axGantt1.BeginUpdate(); EXGANTTLib.Chart chart = axGantt1.Chart; DateTime d = Convert.ToDateTime(chart.FirstVisibleDate); while ( chart.get_IsDateVisible(d) ) { if ( d.Day == 11 ) if ( !chart.get_IsNonworkingDate( d ) ) chart.AddNonworkingDate(d); d = chart.get_NextDate(d, EXGANTTLib.UnitEnum.exDay, 1); } axGantt1.EndUpdate(); } }
The following VFP sample marks the 11th of each month as nonworking day ( DateChange event ):
*** ActiveX Control Event *** With thisform.Gantt1 .BeginUpdate With .Chart local d d = .FirstVisibleDate Do While .IsDateVisible(d) If Day(d) = 11 Then If Not (.IsNonworkingDate(d)) Then .AddNonworkingDate(d) EndIf EndIf d = .NextDate(d, 4096, 1) enddo EndWith .EndUpdate EndWith