method Bars.AddShapeCorner (Key as Variant, Icon as Variant)
Adds a custom shape corner.

 TypeDescription 
   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.  
Use the AddShapeCorner method to define a corner from an icon. Use the StartShape and EndShape properties to define the start and end parts of the bar using custom shapes. Use the Images or ReplaceIcon method to update the list of control's icons. Use the RemoveShapeCorner method to remove a custom shape. The control includes a list of predefined shapes like shown in the ShapeCornerEnum type.

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_gantt.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 AxGantt1.Chart.Bars
    .AddShapeCorner(12345, 1)
    With .Add("Task2")
        .Pattern = EXGANTTLib.PatternEnum.exPatternDot
        .Shape = EXGANTTLib.ShapeBarEnum.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:

axGantt1.Chart.Bars.AddShapeCorner(12345, 1);
EXGANTTLib.Bar bar = axGantt1.Chart.Bars.Add("Task2");
bar.Pattern = EXGANTTLib.PatternEnum.exPatternDot;
bar.Shape = EXGANTTLib.ShapeBarEnum.exShapeThinDown;
bar.EndShape = (EXGANTTLib.ShapeCornerEnum)12345;
bar.EndColor = ToUInt32(Color.FromArgb(255, 0, 0));
bar.Color = bar.EndColor;

The following VFP sample adds a custom shape and defines a bar like above:

With thisform.Gantt1.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


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