Back to Devexpress

ShapeCollection.AddShape(ShapeGeometryPreset, Cell, Single, Single) Method

officefileapi-devexpress-dot-spreadsheet-dot-shapecollection-dot-addshape-x28-devexpress-dot-spreadsheet-dot-shapegeometrypreset-devexpress-dot-spreadsheet-dot-cell-system-dot-single-system-dot-single-x29.md

latest3.1 KB
Original Source

ShapeCollection.AddShape(ShapeGeometryPreset, Cell, Single, Single) Method

Inserts a shape so that its top left corner is located at the specified cell.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
Shape AddShape(
    ShapeGeometryPreset shapePreset,
    Cell topLeftCell,
    float width,
    float height
)
vb
Function AddShape(
    shapePreset As ShapeGeometryPreset,
    topLeftCell As Cell,
    width As Single,
    height As Single
) As Shape

Parameters

NameTypeDescription
shapePresetShapeGeometryPreset

An enumeration member that specifies the shape’s geometry.

| | topLeftCell | Cell |

A cell where the top left corner of the shape should be located.

| | width | Single |

The shape’s width. The ISpreadsheetComponent.Unit property determines the unit of measurement.

| | height | Single |

The shape’s height. The ISpreadsheetComponent.Unit property determines the unit of measurement.

|

Returns

TypeDescription
Shape

The resulting shape.

|

Remarks

Use the Shape.ShapeType property to determine a drawing object’s type in a ShapeCollection. The ShapeGeometry.Preset property returns a shape’s geometry type.

The Shape.Fill and Shape.Outline properties allow you to change a shape’s fill and outline settings.

Use the ShapeCollection.RemoveAt or Shape.Delete method to delete a shape.

See Also

ShapeCollection Interface

ShapeCollection Members

DevExpress.Spreadsheet Namespace