ITabRange.Expand

Fore Syntax

Expand;

Fore.NET Syntax

Expand();

Description

The Expand method expand the size of the current range to the size of the united range into which it is included.

Comment. This method can be used for a range that is included into a united cells range.

Example

To execute the example a form with the button on it named Button1, the TabSheetBox component named TabSheetBox1 name and a data source for TabSheetBox1 are required.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        TSheet: ITabSheet;
        TRange: ITabRange;
    Begin
        TSheet := TabSheetBox1.Source.GetTabSheet;
        TRange := TSheet.View.Selection.Range;
        TRange.Merge;
        TRange := TSheet.Cell(TRange.Top, TRange.Left);
        TRange.Expand;
        Debug.WriteLine(TRange.Left.ToString + " " + TRange.Top.ToString + " " +
            TRange.Right.ToString + " " + TRange.Bottom.ToString);
    End Sub Button1OnClick;

Clicking the button merges the cell range selected in TabSheetBox1 component. The variable TRange will contain top left cell of this merged range. Borders of this cell will be moved to the borders of the range to which it is included. Values of the cell's borders will be displayed in the console of the development environment.

Fore.NET Example

To execute the example a form with the button on it named Button1, the TabSheetBoxNet component named TabSheetBoxNet1 name and some data source for TabSheetBoxNet1 are required.

    Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
    Var
        TSheet: ITabSheet;
        TRange: ITabRange;
    Begin
        TSheet := TabSheetBoxNet1.Source.GetTabSheet();
        TRange := TSheet.View.Selection.Range;
        TRange.Merge();
        TRange := TSheet.Cell[TRange.Top, TRange.Left];
        TRange.Expand();
        Debug.WriteLine(TRange.Left.ToString + " " + TRange.Top.ToString + " " +
            TRange.Right.ToString + " " + TRange.Bottom.ToString);
    End Sub;

Clicking the button merges the cell range selected in TabSheetBoxNet1 component. The variable TRange will contain top left cell of this merged range. Borders of this cell will be moved to the borders of the range to which it is included. Values of the cell's borders will be displayed in the console of the development environment.

See also:

ITabRange