[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Drawing.IShapes.AddShape

AddShape Method

AddShape(AutoShapeType, double, double, double, double)

Returns the IShape object that represents the new AutoShape in a worksheet.

Declaration
IShape AddShape(AutoShapeType type, double left, double top, double width, double height)
Function AddShape(type As AutoShapeType, left As Double, top As Double, width As Double, height As Double) As IShape
Parameters
Type Name Description
AutoShapeType type

Specifies the type of AutoShape to create.

double left

The position (in points) of the upper-left corner of the AutoShape's boundary box relative to the upper-left corner of the document.

double top

The position (in points) of the upper-left corner of the AutoShape's boundary box relative to the upper-left corner of the document.

double width

The width and height of the AutoShape's boundary box, in points.

double height

The width and height of the AutoShape's boundary box, in points.

Returns
Type Description
IShape

The IShapeThe object.

AddShape(AutoShapeType, IRange)

Returns the IShape object that represents the new AutoShape at the specified range on the current sheet.
The sheet of targetRange and the sheet of the shape being added must be the same sheet.

Declaration
IShape AddShape(AutoShapeType type, IRange targetRange)
Function AddShape(type As AutoShapeType, targetRange As IRange) As IShape
Parameters
Type Name Description
AutoShapeType type

Specifies the type of AutoShape to create.

IRange targetRange

The target range of the current sheet.

Returns
Type Description
IShape

The IShapeThe object.

AddShape(string, AutoShapeType, double, double, double, double)

Returns the IShape object that represents the new AutoShape in a worksheet.

Declaration
IShape AddShape(string name, AutoShapeType type, double left, double top, double width, double height)
Function AddShape(name As String, type As AutoShapeType, left As Double, top As Double, width As Double, height As Double) As IShape
Parameters
Type Name Description
string name

The shape name.

AutoShapeType type

Specifies the type of AutoShape to create.

double left

The position (in points) of the upper-left corner of the AutoShape's boundary box relative to the upper-left corner of the document.

double top

The position (in points) of the upper-left corner of the AutoShape's boundary box relative to the upper-left corner of the document.

double width

The width and height of the AutoShape's boundary box, in points.

double height

The width and height of the AutoShape's boundary box, in points.

Returns
Type Description
IShape

The IShapeThe object.

AddShape(string, AutoShapeType, IRange)

Returns the IShape object that represents the new AutoShape at the specified range on the current sheet.
The sheet of targetRange and the sheet of the shape being added must be the same sheet.

Declaration
IShape AddShape(string name, AutoShapeType type, IRange targetRange)
Function AddShape(name As String, type As AutoShapeType, targetRange As IRange) As IShape
Parameters
Type Name Description
string name

The shape name.

AutoShapeType type

Specifies the type of AutoShape to create.

IRange targetRange

The target range of the current sheet.

Returns
Type Description
IShape

The IShapeThe object.