TX Text Control .NET for Windows Forms

Add Method

Method|Introduced in 23.0
Namespace
TXTextControl.Drawing
Package
TXTextControl.TextControl.WinForms.SDK as TXDrawing.dll from the private NuGet feed or Text Control Offline Packages

Description

Adds an object of the type Shape to the collection.

Syntax

Add(Shape)

Adds an object of the type Shape to the collection. The shape is drawn at its defined location with its defined size.

public int Add(Shape shape);
ParameterDescription
shape

Specifies the shape.

Add(Shape, ShapeCollection.AddStyle)

Adds an object of the type Shape to the collection. The addStyle parameter determines the location and size in which the shape is added.

public int Add(Shape shape, ShapeCollection.AddStyle addStyle);
ParameterDescription
shape

Specifies the shape.

addStyle

Specifies style how to add the shape to the collection.

Examples

The following example adds an item to the shape collection.

var result = shapeCollection.Add(new TXTextControl.Drawing.Shape(), TXTextControl.Drawing.ShapeCollection.AddStyle.Fill);
Console.WriteLine($"Add result: {result}");

Further Reading

  • Inserting Shapes and Drawing Groups –