GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    ExcelShapeCollection Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Represents a collection of ExcelShapes in the worksheet or group.

    • C#
    • VB.NET
    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.Object
    ExcelDrawingCollection<ExcelShape>
    ExcelShapeCollection
    Implements
    System.Collections.Generic.IList<ExcelShape>
    System.Collections.Generic.ICollection<ExcelShape>
    System.Collections.Generic.IEnumerable<ExcelShape>
    System.Collections.IEnumerable

    Methods

    Add(ShapeType, AnchorCell, AnchorCell)

    Adds a new shape to the collection which moves and sizes with cells.

    • C#
    • VB.NET
    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
    ExcelShape

    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.

    • C#
    • VB.NET
    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
    ExcelShape

    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.

    • C#
    • VB.NET
    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
    ExcelShape

    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.

    • C#
    • VB.NET
    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
    ExcelShape

    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.

    • C#
    • VB.NET
    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
    ExcelShape

    A new shape added to the collection which moves and sizes with cells.

    Implements

    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    See Also

    Shapes
    Shapes
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.