![]() | Type | Description | ||
| Color | A Color expression that indicates the color for the ending part of the bar. |
In VB.NET or C# you require the following functions until the .NET framework will provide:
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
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 WithThe 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