Add Method
- Namespace
TXTextControl.Drawing
- Package
TXTextControl.asTextControl. WinForms. SDK TXDrawing.from the private NuGet feed or Text Control Offline Packagesdll
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);Public Function Add(shape As Shape) As Integer| Parameter | Description |
|---|---|
| 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);Public Function Add(shape As Shape, addStyle As ShapeCollection.AddStyle) As Integer| Parameter | Description |
|---|---|
| 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}");Dim result = shapeCollection.Add(New TXTextControl.Drawing.Shape(), TXTextControl.Drawing.ShapeCollection.AddStyle.Fill)
Console.WriteLine($"Add result: {result}")