Insert(Index: Integer; Sheet: IPageControlSheet);
Index. The position, to which a page is inserted.
Sheet. The page, which will be inserted into the specified position.
The Insert method inserts a new page into the specified position of the collection.
The method is applied only to the new pages, which are not yet added to the collection. Use the IPageControlSheet.SheetIndex property to manage position of existing pages.
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 := New PageControlSheet.Create;
Sheet.Text := "Introduction";
Sheets.Insert(0, Sheet);
End Sub Button1OnClick;
Clicking the button adds a new page to the pages collection. A page tab will be placed in the beginning of the list.
See also: