Shape.MoveToRange

Shape.MoveToRange method

Moves the shape to a specified range.

public void MoveToRange(int upperLeftRow, int upperLeftColumn, int lowerRightRow, 
    int lowerRightColumn)
ParameterTypeDescription
upperLeftRowInt32Upper left row index.
upperLeftColumnInt32Upper left column index.
lowerRightRowInt32Lower right row index
lowerRightColumnInt32Lower 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