property Bar.EndColor as Color
Returns or sets a value that indicates the color for the right side corner.

 TypeDescription 
   Color A Color expression that indicates the color for the ending part of the bar.  
Use the EndColor property to specify the color to fill the end part of the bar, if the EndShape property is not exShapeIconEmpty. Use the Color property to specify the color to fill the middle part of the bar. Use the StartColor and StartShape properties to define the look and feel for the starting part of the bar. 

In VB.NET or C# you require the following functions until the .NET framework will provide:

You can use the following VB.NET function:
     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 
You can use the following C# function:
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 VB sample defines a new bar that looks like this :

With Gantt1.Chart.Bars.Add("Task2")
    .Pattern = exPatternShadow
    .Color = RGB(0, 0, 255)
    .EndShape = exShapeIconCircleDot
    .EndColor = RGB(255, 0, 0)
End With

The following C++ sample defines a bar that looks like this above:

CBar bar = m_gantt.GetChart().GetBars().Add("Task2");
bar.SetPattern( 3 /*exPatternShadow*/ );
bar.SetColor( RGB(0, 0, 255) );
bar.SetEndShape( 4 /* exShapeIconCircleDot*/ );
bar.SetEndColor( RGB(255, 0, 0) );

The following VB.NET sample defines a bar that looks like this above:

With AxGantt1.Chart.Bars.Add("Task2")
    .Pattern = EXGANTTLib.PatternEnum.exPatternShadow
    .Color = RGB(0, 0, 255)
    .EndShape = EXGANTTLib.ShapeCornerEnum.exShapeIconCircleDot
    .EndColor = RGB(255, 0, 0)
End With

The following C# sample defines a bar that looks like this above:

EXGANTTLib.Bar bar = axGantt1.Chart.Bars.Add("Task2");
bar.Pattern = EXGANTTLib.PatternEnum.exPatternShadow;
bar.Color = ToUInt32(Color.FromArgb(0, 0, 255));
bar.EndShape = EXGANTTLib.ShapeCornerEnum.exShapeIconCircleDot;
bar.EndColor = ToUInt32(Color.FromArgb(255, 0, 0));

The following VFP sample defines a bar that looks like this above:

with thisform.Gantt1.Chart.Bars.Add("Task2")
	.Pattern = 3 && exPatternShadow
	.Color = RGB(0, 0, 255)
	.EndShape = 4 && exShapeIconCircleDot
	.EndColor = RGB(255, 0, 0)
EndWith

 


Send comments on this topic.
© 1999-2006 Exontrol Inc, Software. All rights reserved.