ITabRange.Offset

Syntax

Offset(

RowCount: Integer;

ColumnCount: Integer;

[Height: Integer = 0;]

[Width: Integer = 0]): ITabRange;

Parameters

RowCount. Number of rows by which the range is to be shifted.

ColumnCount. Number of columns by which the range is to be shifted.

Height. height of returned range measured in cells.

Width. Width of returned range in cells.

Description

The Offset method returns the cell ranges, shifted according to the specified parameters.

Comments

Shifting is done by RowCount rows, ColumnCount columns and is calculated from the current range. By default, the height and the width of the returned range matches the width and the height of the source range. Using the Height and Width parameters, the height and width of the returned range can be set.

Example

Executing the example requires a form with the Button1 button located on it, the UiTabSheet component named UiTabSheet1 and the TabSheetBox component. Current cell range A0.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

Range: ITabRange;

OffRange: ITabRange;

Begin

Range := UiTabSheet1.TabSheet.View.Selection.Range;

OffRange := Range.Offset(1, 2, 3, 4);

OffRange.Style.BackgroundColor := GxColor.FromName("Red");

End Sub Button1OnClick;

Executing this example changes the background color of the range offset from the current one based on the specified parameters:

See also:

ITabRange