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

    Show / Hide Table of Contents

    AnchorCell Class

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

    Represents an anchor cell object used in ExcelDrawingPosition type to specify from which cell and to which cell drawing (picture, chart, etc.) spans.

    • C#
    • VB.NET
    public sealed class AnchorCell : IEquatable<AnchorCell>
    Public NotInheritable Class AnchorCell
        Implements IEquatable(Of AnchorCell)
    Inheritance:
    System.Object
    AnchorCell
    Implements
    System.IEquatable<AnchorCell>

    Constructors

    AnchorCell(AnchorCell)

    Initializes a new instance of the AnchorCell class by using another anchor cell.

    • C#
    • VB.NET
    public AnchorCell(AnchorCell anchorCell)
    Public Sub New(anchorCell As AnchorCell)
    Parameters
    anchorCell
    AnchorCell

    Anchor cell to copy from.

    Exceptions
    System.ArgumentNullException

    anchorCell is null.

    AnchorCell(ExcelCell, Boolean)

    Initializes a new instance of the AnchorCell class.

    • C#
    • VB.NET
    public AnchorCell(ExcelCell cell, bool topLeft)
    Public Sub New(cell As ExcelCell, topLeft As Boolean)
    Parameters
    cell
    ExcelCell

    The cell where the anchor is placed.

    topLeft
    System.Boolean

    If set to true, anchor will be placed in the top left corner of the cell in current column and current row; otherwise, anchor will be placed in the top-left corner of the cell in next column and next row.

    AnchorCell(ExcelColumn, ExcelRow, Boolean)

    Initializes a new instance of the AnchorCell class.

    • C#
    • VB.NET
    public AnchorCell(ExcelColumn column, ExcelRow row, bool topLeft)
    Public Sub New(column As ExcelColumn, row As ExcelRow, topLeft As Boolean)
    Parameters
    column
    ExcelColumn

    The column where the anchor is placed.

    row
    ExcelRow

    The row where the anchor is placed.

    topLeft
    System.Boolean

    If set to true, anchor will be placed in the top left corner of the cell in current column and current row; otherwise, anchor will be placed in the top-left corner of the cell in next column and next row.

    AnchorCell(ExcelColumn, ExcelRow, Double, Double, LengthUnit)

    Initializes a new instance of the AnchorCell class by using offset values in arbitrary length unit.

    • C#
    • VB.NET
    public AnchorCell(ExcelColumn column, ExcelRow row, double columnOffset, double rowOffset, LengthUnit unit)
    Public Sub New(column As ExcelColumn, row As ExcelRow, columnOffset As Double, rowOffset As Double, unit As LengthUnit)
    Parameters
    column
    ExcelColumn

    The column where the anchor is placed.

    row
    ExcelRow

    The row where the anchor is placed.

    columnOffset
    System.Double

    The column offset for the anchor in arbitrary length unit.

    rowOffset
    System.Double

    The row offset for the anchor in arbitrary length unit.

    unit
    LengthUnit

    The length unit in which columnOffset and rowOffset are specified.

    Exceptions
    System.ArgumentNullException

    column or row is null.

    System.ArgumentException

    column and row do not belong to the same worksheet.

    AnchorCell(ExcelColumn, ExcelRow, Int64, Int64)

    Initializes a new instance of the AnchorCell class by using offset values in EMU units (1 point = 12 700 EMU).

    • C#
    • VB.NET
    public AnchorCell(ExcelColumn column, ExcelRow row, long columnOffset, long rowOffset)
    Public Sub New(column As ExcelColumn, row As ExcelRow, columnOffset As Long, rowOffset As Long)
    Parameters
    column
    ExcelColumn

    The column where the anchor is placed.

    row
    ExcelRow

    The row where the anchor is placed.

    columnOffset
    System.Int64

    The column offset for the anchor.

    rowOffset
    System.Int64

    The row offset for the anchor.

    Exceptions
    System.ArgumentNullException

    column or row is null.

    System.ArgumentException

    column and row do not belong to the same worksheet.

    Properties

    Column

    Gets or sets the column for the anchor cell.

    • C#
    • VB.NET
    public ExcelColumn Column { get; set; }
    Public Property Column As ExcelColumn
    Property Value
    ExcelColumn

    The column for the anchor cell.

    Exceptions
    System.ArgumentNullException

    Value is null.

    System.ArgumentException

    Column doesn't belong to the same worksheet as anchor cell row.

    ColumnOffset

    Gets or sets the column offset for the anchor cell in EMU units (1 point = 12 700 EMU).

    • C#
    • VB.NET
    public long ColumnOffset { get; set; }
    Public Property ColumnOffset As Long
    Property Value
    System.Int64

    The column offset for the anchor cell in EMU units (1 point = 12 700 EMU).

    Remarks

    LengthUnit for this property is Emu (English Metric Unit) (1 point = 12 700 EMU) for historical reasons.

    Use GetColumnOffset(LengthUnit) and SetColumnOffset(Double, LengthUnit) methods to get or set the ColumnOffset using arbitrary LengthUnit.

    ColumnOffset is constrained to Column.Width.

    Row

    Gets or sets the row for the anchor cell.

    • C#
    • VB.NET
    public ExcelRow Row { get; set; }
    Public Property Row As ExcelRow
    Property Value
    ExcelRow

    The row for the anchor cell.

    Exceptions
    System.ArgumentNullException

    Value is null.

    System.ArgumentException

    Row doesn't belong to the same worksheet as anchor cell column.

    RowOffset

    Gets or sets row offset for the anchor cell in EMU units (1 point = 12 700 EMU).

    • C#
    • VB.NET
    public long RowOffset { get; set; }
    Public Property RowOffset As Long
    Property Value
    System.Int64

    The row offset for the anchor cell in EMU units (1 point = 12 700 EMU).

    Remarks

    LengthUnit for this property is Emu (English Metric Unit) (1 point = 12 700 EMU) for historical reasons.

    Use GetRowOffset(LengthUnit) and SetRowOffset(Double, LengthUnit) methods to get or set the RowOffset using arbitrary LengthUnit.

    RowOffset is constrained to Row.Height.

    Methods

    Equals(AnchorCell)

    Determines whether the other AnchorCell is equal to this AnchorCell instance.

    • C#
    • VB.NET
    public bool Equals(AnchorCell other)
    Public Function Equals(other As AnchorCell) As Boolean
    Parameters
    other
    AnchorCell

    The other anchor cell to compare with this anchor cell instance.

    Returns
    System.Boolean

    true if the other AnchorCell is equal to this AnchorCell instance; otherwise, false.

    Equals(Object)

    Determines whether the specified System.Object is equal to this AnchorCell instance.

    • C#
    • VB.NET
    public override bool Equals(object obj)
    Public Overrides Function Equals(obj As Object) As Boolean
    Parameters
    obj
    System.Object

    The System.Object to compare with this anchor cell instance.

    Returns
    System.Boolean

    true if the specified System.Object is an AnchorCell and is equal to this AnchorCell instance; otherwise, false.

    Overrides
    System.Object.Equals(System.Object)

    GetColumnOffset(LengthUnit)

    Gets the column offset for the anchor cell in arbitrary length unit.

    • C#
    • VB.NET
    public double GetColumnOffset(LengthUnit unit)
    Public Function GetColumnOffset(unit As LengthUnit) As Double
    Parameters
    unit
    LengthUnit

    The length unit in which to return column offset.

    Returns
    System.Double

    The column offset for the anchor cell in arbitrary length unit.

    Remarks

    ColumnOffset is constrained to Column.Width.

    GetHashCode()

    Returns a hash code for this AnchorCell instance.

    • C#
    • VB.NET
    public override int GetHashCode()
    Public Overrides Function GetHashCode As Integer
    Returns
    System.Int32

    An integer value that specifies a hash value for this AnchorCell instance.

    Overrides
    System.Object.GetHashCode()

    GetRowOffset(LengthUnit)

    Gets the row offset for the anchor cell in arbitrary length unit.

    • C#
    • VB.NET
    public double GetRowOffset(LengthUnit unit)
    Public Function GetRowOffset(unit As LengthUnit) As Double
    Parameters
    unit
    LengthUnit

    The length unit in which to return row offset.

    Returns
    System.Double

    The row offset for the anchor cell in arbitrary length unit.

    Remarks

    RowOffset is constrained to Row.Height.

    SetColumnOffset(Double, LengthUnit)

    Sets the column offset for the anchor cell in arbitrary length unit.

    • C#
    • VB.NET
    public void SetColumnOffset(double value, LengthUnit unit)
    Public Sub SetColumnOffset(value As Double, unit As LengthUnit)
    Parameters
    value
    System.Double

    The column offset value.

    unit
    LengthUnit

    The length unit in which value is specified.

    SetRowOffset(Double, LengthUnit)

    Sets the row offset for the anchor cell in arbitrary length unit.

    • C#
    • VB.NET
    public void SetRowOffset(double value, LengthUnit unit)
    Public Sub SetRowOffset(value As Double, unit As LengthUnit)
    Parameters
    value
    System.Double

    The row offset value.

    unit
    LengthUnit

    The length unit in which value is specified.

    ToString()

    Returns a System.String that represents this AnchorCell instance.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this AnchorCell instance.

    Overrides
    System.Object.ToString()
    Remarks

    This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).

    Implements

    System.IEquatable<T>
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.