Expand;
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.
Executing the example requires a form with the Button1 button located on it, the TabSheetBox component named TabSheetBox1 and a data source for TabSheetBox1.
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.
See also: