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

 TypeDescription 
   Color A Color expression that indicates the color for the starting part of the bar.  
Use the StartColor property to specify the color to fill the start part of the bar, if the StartShape property is not exShapeIconEmpty. Use the Color property to specify the color to fill the middle part of the bar. Use the EndColor and EndShape properties to define the appearance of 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)
    .StartShape = exShapeIconCircleDot
    .StartColor = 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.SetStartShape( 4 /* exShapeIconCircleDot*/ );
bar.SetStartColor( 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)
    .StartShape = EXGANTTLib.ShapeCornerEnum.exShapeIconCircleDot
    .StartColor = RGB(255, 0, 0)
End With

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

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

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)
	.StartShape = 4 && exShapeIconCircleDot
	.StartColor = RGB(255, 0, 0)
EndWith
 


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