

| Type | Description | |||
| Key as Variant | A Long expression that indicates the key of the new icon being added | |||
| Icon as Variant | A long expression that indicates the handle of the icon being inserted, or the index of the icon being added. |
The following VB sample adds a custom shape
and defines a bar like this
:
With .Chart.Bars
.AddShapeCorner 12345, 1
With .Add("Task2")
.Pattern = exPatternDot
.Shape = exShapeThinDown
.EndShape = 12345
.EndColor = RGB(255, 0, 0)
.Color = .EndColor
End With
End With
The following C++ sample adds a custom shape and defines a bar like above:
CBars bars = m_g2antt.GetChart().GetBars();
bars.AddShapeCorner( COleVariant( (long)12345 ), COleVariant( (long)1 ) );
CBar bar = bars.Add("Task2");
bar.SetPattern( 2 /*exPatternDot*/ );
bar.SetShape( 20 /*exShapeThinDown*/ );
bar.SetEndShape( 12345 );
bar.SetEndColor( RGB(255, 0, 0) );
bar.SetColor( bar.GetEndColor() );
The following VB.NET sample adds a custom shape and defines a bar like above:
With AxG2antt1.Chart.Bars
.AddShapeCorner(12345, 1)
With .Add("Task2")
.Pattern = EXG2ANTTLib.PatternEnum.exPatternDot
.Shape = EXG2ANTTLib.ShapeBarEnum.exShapeThinDown
.EndShape = 12345
.EndColor = RGB(255, 0, 0)
.Color = .EndColor
End With
End With
The following VB.NET sample adds a custom icon to the start of all Task bars:
With AxG2antt1.Chart.Bars
.AddShapeCorner(12345, 1)
.Item("Task").StartShape = 12345
.Item("Task").StartColor = UInteger.MaxValue
End With
The following C# sample adds a custom shape and defines a bar like above:
axG2antt1.Chart.Bars.AddShapeCorner(12345, 1);
EXG2ANTTLib.Bar bar = axG2antt1.Chart.Bars.Add("Task2");
bar.Pattern = EXG2ANTTLib.PatternEnum.exPatternDot;
bar.Shape = EXG2ANTTLib.ShapeBarEnum.exShapeThinDown;
bar.EndShape = (EXG2ANTTLib.ShapeCornerEnum)12345;
bar.EndColor = ToUInt32(Color.FromArgb(255, 0, 0));
bar.Color = bar.EndColor;
The following C# sample adds a custom icon to the start of all Task bars:
EXG2ANTTLib.Bars bars = axG2antt1.Chart.Bars; bars.AddShapeCorner(12345, 1); bars["Task"].StartShape = EXG2ANTTLib.ShapeCornerEnum.exShapeIconEmpty + 12345; bars["Task"].StartColor = 0xFFFFFFFF;
The following VFP sample adds a custom shape and defines a bar like above:
With thisform.G2antt1.Chart.Bars
.AddShapeCorner(12345, 1)
With .Add("Task2")
.Pattern = 2 && exPatternDot
.Shape = 20 && exShapeThinDown
.EndShape = 12345
.EndColor = RGB(255, 0, 0)
.Color = .EndColor
EndWith
EndWith