ITabRange.Offset

Fore Syntax

Offset(

RowCount: Integer;

ColumnCount: Integer;

[Height: Integer = 0;]

[Width: Integer = 0]): ITabRange;

Fore.NET Syntax

Offset(

RowCount: Integer;

ColumnCount: Integer;

Height: Integer;

Width: Integer): Prognoz.Platform.Interop.Tab.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

To execute the example a form with a button on this form named Button1, the component UiTabSheet named UiTabSheet1 and the component TabSheetBox are required. 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