IPageControlSheet.SheetIndex

Syntax

SheetIndex: Integer;

Description

The SheetIndex property determines index of the current page in the collection.

Comments

It is possible to manage page position in the general collection by changing value of this property. Page position in the collection affects page tab position in the component's visual interface. If the value is increased, the tab is moved to the right edge of the component, if the value is decreased, the tab is moved to the left edge. Available value of the property is in the range [0; IPageControlSheets.Count - 1].

Example

Executing the example requires a form with the Button1 button and the Panel component named Panel1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Sheets: IPageControlSheets;
    Sheet: IPageControlSheet;
Begin
    Sheets := PageControl1.Pages;
    Sheet := Sheets.Item(Sheets.Count - 1);
    Sheet.SheetIndex := 0;
End Sub Button1OnClick;

On clicking the button the last page will be moved to the beginning of the collection. The page tab will also be moved to the beginning of the list.

See also:

IPageControlSheet