ITabSheet.Columns

Fore Syntax

Columns(Start: Integer; Finish: Integer): ITabRange;

Fore.NET Syntax

Columns[Start: Integer; Finish: Integer]: Prognoz.Platform.Interop.Tab.ITabRange;

Parameters

Start. Number of the first column in the range.

Finish. Number of the last column in the range.

Admissible value of all parameters lies within the [0; ColumnsCount) range.

Description

The Columns property returns the table columns, the range of which is passed as the Start and the Finish input parameters.

Fore Example

Executing the example requires a form, a button on this form named Button1, the UiTabSheet component named UiTabSheet1 and the TabSheetBox component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        Tab: ITabSheet;
    Begin
        Tab := UiTabSheet1.TabSheet;
        Tab.RowsCount := 5;
        Tab.ColumnsCount := 5;
        Tab.Columns(01).Value := 10;
        Tab.Rows(01).Value := 10;
    End Sub Button1OnClick;

Sub Button2OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        r, c: integer;
        Tab: ITabSheet;
    Begin
        Tab := UiTabSheet1.TabSheet;
        r := Tab.MaxUsedRow;
        c := Tab.MaxUsedColumn;
        Self.Text := "Number of used rows: " + r.ToString + ". Number of used columns: " + c.ToString;
    End Sub Button2OnClick;

Clicking the Button1 button limits the number of rows and columns to 5. Columns and rows are assigned with the 10 value. Clicking the Button2 button displays maximum row and column address in the form title.

Fore.NET Example

The requirements and result of the Fore.NET Example execution match with those in the Fore Example. Use Fore.NET analogs instead of Fore components.

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
    Var
        Tab: ITabSheet;
    Begin
        Tab := UiTabSheetNet1.TabSheetUi.TabSheet;
        Tab.RowsCount := 5;
        Tab.ColumnsCount := 5;
        Tab.Columns[01].Value := 10;
        Tab.Rows[01].Value := 10;
    End Sub;

Private Sub button2_Click(sender: System.Object; e: System.EventArgs);
    Var
        r, c: integer;
        Tab: ITabSheet;
    Begin
        Tab := UiTabSheetNet1.TabSheetUi.TabSheet;
        r := Tab.MaxUsedRow[False];
        c := Tab.MaxUsedColumn[False];
        Self.Text := "Number of used rows: " + r.ToString() + ". Number of used columns: " + c.ToString();
    End Sub;

See also:

ITabSheet