ExcelShapeCollection Class
Represents a collection of ExcelShapes in the worksheet or group.
public class ExcelShapeCollection : ExcelDrawingCollection<ExcelShape>, IList<ExcelShape>, ICollection<ExcelShape>, IEnumerable<ExcelShape>, IEnumerable
Public Class ExcelShapeCollection
Inherits ExcelDrawingCollection(Of ExcelShape)
Implements IList(Of ExcelShape), ICollection(Of ExcelShape), IEnumerable(Of ExcelShape), IEnumerable
- Inheritance:
- System.ObjectExcelShapeCollection
Implements
Methods
Add(ShapeType, AnchorCell, AnchorCell)
Adds a new shape to the collection which moves and sizes with cells.
public ExcelShape Add(ShapeType shapeType, AnchorCell positionFrom, AnchorCell positionTo)
Public Function Add(shapeType As ShapeType, positionFrom As AnchorCell, positionTo As AnchorCell) As ExcelShape
Parameters
shapeType
- ShapeType
The type of the shape.
positionFrom
- AnchorCell
The shape's position (top-left corner).
positionTo
- AnchorCell
The shape's end position (bottom-right corner).
Returns
A new shape added to the collection which moves and sizes with cells.
Add(ShapeType, AnchorCell, Double, Double, LengthUnit)
Adds a new shape to the collection which moves but doesn't size with cells.
public ExcelShape Add(ShapeType shapeType, AnchorCell positionFrom, double width, double height, LengthUnit unit)
Public Function Add(shapeType As ShapeType, positionFrom As AnchorCell, width As Double, height As Double, unit As LengthUnit) As ExcelShape
Parameters
shapeType
- ShapeType
The type of the shape.
positionFrom
- AnchorCell
The shape's position.
width
- System.Double
The shape's width.
height
- System.Double
The shape's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
A new shape added to the collection which moves but doesn't size with cells.
Add(ShapeType, Double, Double, Double, Double, LengthUnit)
Adds a new shape to the collection which doesn't move nor sizes with cells.
public ExcelShape Add(ShapeType shapeType, double left, double top, double width, double height, LengthUnit unit)
Public Function Add(shapeType As ShapeType, left As Double, top As Double, width As Double, height As Double, unit As LengthUnit) As ExcelShape
Parameters
shapeType
- ShapeType
The type of the shape.
left
- System.Double
The distance of the left edge of the shape from the left edge of the worksheet or group.
top
- System.Double
The distance of the top edge of the shape from the top edge of the worksheet or group.
width
- System.Double
The shape's width.
height
- System.Double
The shape's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
A new shape added to the collection which doesn't move nor sizes with cells.
Add(ShapeType, String, Double, Double, LengthUnit)
Adds a new shape to the collection which moves but doesn't size with cells.
public ExcelShape Add(ShapeType shapeType, string positionFromCell, double width, double height, LengthUnit unit)
Public Function Add(shapeType As ShapeType, positionFromCell As String, width As Double, height As Double, unit As LengthUnit) As ExcelShape
Parameters
shapeType
- ShapeType
The type of the shape.
positionFromCell
- System.String
The shape's position (for example, "A1").
width
- System.Double
The shape's width.
height
- System.Double
The shape's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
A new shape added to the collection which moves but doesn't size with cells.
Add(ShapeType, String, String)
Adds a new shape to the collection which moves and sizes with cells.
public ExcelShape Add(ShapeType shapeType, string positionFromCell, string positionToCell)
Public Function Add(shapeType As ShapeType, positionFromCell As String, positionToCell As String) As ExcelShape
Parameters
shapeType
- ShapeType
The type of the shape.
positionFromCell
- System.String
The shape's position (top-left corner) (for example, "A1").
positionToCell
- System.String
The shape's end position (bottom-right corner) (for example, "B2").
Returns
A new shape added to the collection which moves and sizes with cells.