HorizontalPageBreakCollection.Item

HorizontalPageBreakCollection indexer (1 of 2)

Gets the HorizontalPageBreak element at the specified index.

public HorizontalPageBreak this[int index] { get; }
ParameterDescription
indexThe zero based index of the element.

Return Value

The element at the specified index.

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class HorizontalPageBreakCollectionPropertyItemDemo
    {
        public static void Run()
        {
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];
            
            // Add horizontal page breaks
            worksheet.HorizontalPageBreaks.Add(5);
            worksheet.HorizontalPageBreaks.Add(10);
            
            // Access page breaks using Item property
            HorizontalPageBreak firstBreak = worksheet.HorizontalPageBreaks[0];
            Console.WriteLine("First page break row: " + firstBreak.Row);
            
            // Modify cells which affects page breaks
            worksheet.Cells.DeleteRows(0, 2);
            
            // Verify the page break was adjusted
            Console.WriteLine("First page break after row deletion: " + worksheet.HorizontalPageBreaks[0].Row);
        }
    }
}

See Also


HorizontalPageBreakCollection indexer (2 of 2)

Gets the HorizontalPageBreak element with the specified cell name.

public HorizontalPageBreak this[string cellName] { get; }
ParameterDescription
cellNameCell name.

Return Value

The element with the specified cell name.

See Also