Shape.MoveToRange

Shape.MoveToRange method

Moves the shape to a specified range.

public void MoveToRange(int topRow, int leftColumn, int bottomRow, int rightColumn)
ParameterTypeDescription
topRowInt32Upper left row index.
leftColumnInt32Upper left column index.
bottomRowInt32Lower right row index
rightColumnInt32Lower right column index

Examples

using System;
using Aspose.Cells;
using Aspose.Cells.Drawing;

namespace AsposeCellsExamples
{
    public class ShapeMethodMoveToRangeWithInt32Int32Int32Int32Demo
    {
        public static void Run()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            // Add a shape to the worksheet
            Shape shape = worksheet.Shapes.AddRectangle(1, 1, 100, 100, 0, 0);

            // Move the shape to a specific range
            shape.MoveToRange(12, 3, 13, 5);

            // Save the workbook
            workbook.Save("ShapeMoveToRangeDemo.xlsx");
        }
    }
}

See Also