![]() | 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 G2antt1_DateChange()
With G2antt1
.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 SubThe following VB.NET sample marks the 11th of each month as nonworking day:
Private Sub AxG2antt1_DateChange(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxG2antt1.DateChange
With AxG2antt1
.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, EXG2ANTTLib.UnitEnum.exDay, 1)
Loop
End With
.EndUpdate()
End With
End SubThe following C# sample marks the 11th of each month as nonworking day:
private void axG2antt1_DateChange(object sender, EventArgs e)
{
axG2antt1.BeginUpdate();
EXG2ANTTLib.Chart chart = axG2antt1.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, EXG2ANTTLib.UnitEnum.exDay, 1);
}
axG2antt1.EndUpdate();
}
}The following VFP sample marks the 11th of each month as nonworking day ( DateChange event ):
*** ActiveX Control Event ***
With thisform.G2antt1
.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