property Chart.NonworkingDaysColor as Color
Retrieves or sets a value that indicates the color to fill the non-working days.

 TypeDescription 
   Color A Color expression that indicates the color to fill the non-working days.  
Use the NonworkingDaysColor property to specify the color being used by the NonworkingDaysPattern property. Use the NonworkingDays property to specify the nonworking days in a week. Use the AddNonworkingDate method to add custom dates as nonworking days. Use the NonworkingDaysPattern property to specify the pattern to fill the non-working days. Use the ShowNonworkingDates property to show or hide the nonworking dates in the control's chart area. For instance, if  the NonworkingDaysPattern is exPatternEmpty the non-working days are not highlighted.

The following VB sample marks Sunday and Monday days on red:

With Gantt1.Chart
    .NonworkingDays = 2 ^ (EXGANTTLibCtl.exSunday) Or 2 ^ (EXGANTTLibCtl.exMonday)
    .NonworkingDaysColor = RGB(255, 0, 0)
End With

The following C++ sample sample marks Sunday and Monday days on red:

m_gantt.GetChart().SetNonworkingDays( 1 << ( EXGANTTLib::exSunday) | 1 << ( EXGANTTLib::exMonday ) );
m_gantt.GetChart().SetNonworkingDaysColor( RGB(255,0,0,) );

where the #import <exgantt.dll> must be called to insert definitions for types in the control's type library.

The following VB.NET sample marks Sunday and Monday days on red:

With AxGantt1.Chart
    .NonworkingDays = 2 ^ (EXGANTTLib.WeekDayEnum.exSunday) Or 2 ^ (EXGANTTLib.WeekDayEnum.exMonday)
    .NonworkingDaysColor = ToUInt32(Color.Red)
End With

where the ToUInt32 function converts a Color expression to a OLE_DATE expression:

Shared Function ToUInt32(ByVal c As Color) As UInt32
    Dim i As Long
    i = c.R
    i = i + 256 * c.G
    i = i + 256 * 256 * c.B
    ToUInt32 = Convert.ToUInt32(i)
End Function

The following C# sample marks Sunday and Monday days on red:

axGantt1.Chart.NonworkingDays = 1 << (Convert.ToInt32(EXGANTTLib.WeekDayEnum.exSunday)) | 1 << (Convert.ToInt32(EXGANTTLib.WeekDayEnum.exMonday));
axGantt1.Chart.NonworkingDaysColor = ToUInt32( Color.Red );

where the ToUInt32 function converts a Color expression to a OLE_DATE expression:

private UInt32 ToUInt32(Color c)
{
	long i;
	i = c.R;
	i = i + 256 * c.G;
	i = i + 256 * 256 * c.B;
	return Convert.ToUInt32(i);
}

The following VFP sample sample marks Sunday and Monday days on red:

with thisform.Gantt1.Chart
	.NonworkingDays = 2 ^ 0 + 2 ^ 1
	.NonworkingDaysColor = RGB(255,0,0)
endwith

 


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.