[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TPageControl

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements a multi-page component with a series of tabs.

## Declaration

Source position: comctrls.pp line 577

`type TPageControl = class(TCustomTabControl)`
`protected`
`class procedure WSRegisterClass; override;` |  | Registers this component class with the current WidgetSet.
`function GetPageClass; override;` |  | Gets the class type used to create a new tab sheet (or page) for the page control.
`procedure DoAddDockClient(); override;` |  | DoAddDockClient creates a new tab sheet in the PageControl, places the client on it and aligns it.
`procedure DockOver(); override;` |  | Called to check whether this control allows docking and where.
`procedure DoRemoveDockClient(); override;` |  | DoRemoveDockClient - frees the page which is being undocked.
`function DoUndockClientMsg(); override;` |  | Notifies the DockManager of the undock of a client control.
`function ChildClassAllowed(); override;` |  | Determines whether the specified class can be a child control on the TPageControl instance.
`procedure UpdateDockCaption(); override;` |  | Updates page captions to reflect the captions for docked clients controls.
`public`
`procedure Clear;` |  | Clears the list of tab names in the control, and frees the associated tab sheets or pages.
`function FindNextPage();` |  | Gets the next tab sheet in the specified direction.
`procedure SelectNextPage();` |  | Locates and activates the next page in the specified direction.
`function IndexOfTabAt();` |  | Returns the ordinal position for the visible tab located at the specified client coordinates.
`function IndexOfPageAt();` |  | Gets the ordinal position for the page object located at the specified client coordinates.
`function AddTabSheet;` |  | Creates and configures a new tab sheet for the page control.
`property ActivePageIndex: Integer; [rw]` |  | Ordinal position for the active page (tab sheet) on the page control.
`property Pages []: TTabSheet; [r]` |  | Provides indexed access to the pages (tab sheets) on the page control.
`published`
`property ActivePage: TTabSheet; [rw]` |  | The currently selected and active page (TTabSheet) on the page control.
`property OnGetDockCaption: TGetDockCaptionEvent;` |  | This handler can provide a special DockCaption, different than the Caption default.
`property Align: TAlign;` |  | Specifies the placement of the control on its Parent control.
`property Anchors: TAnchors;` |  | The set of anchor definitions for this control.
`property AutoSize: Boolean;` |  | Allows automatic adjustment of the size for the control, according to its content.
`property BorderSpacing: TControlBorderSpacing;` |  | Determines the inner and outer border spacing for this control.
`property BiDiMode: TBiDiMode;` |  | Indicates whether text controls use in bi-directional reading.
`property Constraints: TSizeConstraints;` |  | Contains the minimum and maximum Width and Height for the control.
`property DockSite: Boolean;` |  | Allows controls to be drag-and-dock-ed into this control.
`property DragCursor: TCursor;` |  | The cursor shape shown during a drag operation.
`property DragKind: TDragKind;` |  | Indicates the action performed for a drag operation: drag-and-drop or drag-and-dock.
`property DragMode: TDragMode;` |  | Determines how a drag operation is started for the control.
`property Enabled: Boolean;` |  | Determines whether the control responds to mouse or keyboard input.
`property Font: TFont;` |  | The font to be used for text display in this control.
`property HotTrack: Boolean;` |  | Enables or disables drawing a "hot-lighted" tab when the mouse pointer is hovered over the control.
`property Images: TCustomImageList;` |  | Contains the images displayed on the tabs for the control.
`property ImagesWidth: Integer;` |  | Width for the Images used in the control.
`property MultiLine: Boolean;` |  | Indicates whether the caption on a tab can have multiple lines of text.
`property Options: TCTabControlOptions;` |  | The set of Options enabled for the tabbed control.
`property ParentBiDiMode: Boolean;` |  | Indicates whether the BiDiMode settings in the Parent control are used.
`property ParentFont: Boolean;` |  | Indicates if the Font from the Parent control is used in the control.
`property ParentShowHint: Boolean;` |  | If True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True.
`property PopupMenu: TPopupMenu;` |  | A context-sensitive menu that pops up when the right mouse button is clicked over this control.
`property RaggedRight: Boolean;` |  | Enables or disables justified text in the captions for tabs on the control.
`property ScrollOpposite: Boolean;` |  | Indicates whether unused multi-line tabs are scrolled to the side opposite of the tab position.
`property ShowHint: Boolean;` |  | Enables Hint display for the control.
`property ShowTabs: Boolean;` |  | Enables display of tabs on the control when set to True (default).
`property Style: TTabStyle;` |  | Indicates the appearance or display style used for the tabs on the control.
`property TabHeight: SmallInt;` |  | Height in pixels for the tabs on the control.
`property TabIndex: Integer;` |  | Contains the ordinal position for the active Tab in the control.
`property TabOrder: TTabOrder;` |  | Indicates the navigation order for the control when the user presses the Tab or Shift+Tab key.
`property TabPosition: TTabPosition;` |  | Indicates the edge where the tabs for the control are aligned.
`property TabStop: Boolean;` |  | Allows the user to navigate to / from the control by pressing the Tab or Shift+Tab keys.
`property TabWidth: SmallInt;` |  | Width in pixels for the tabs on the control.
`property Visible: Boolean;` |  | Allows the control, and all of its children, to be displayed or hidden.
`property OnChange: TNotifyEvent;` |  | Event handler signalled when the active page (or tab) for the control is changed.
`property OnChanging: TTabChangingEvent;` |  | Event handler signalled prior to changing the active tab/page on the tabbed control.
`property OnCloseTabClicked: TNotifyEvent;` |  | Event handler signalled when a tab is closed.
`property OnContextPopup: TContextPopupEvent;` |  | Invoked when a context-sensitive pop-up menu is requested.
`property OnDockDrop: TDockDropEvent;` |  | Event handler signalled for the drop of a control to be docked.
`property OnDockOver: TDockOverEvent;` |  | Event handler signalled when a control is moved over a docksite; determines whether the drop event is accepted or rejected.
`property OnDragDrop: TDragDropEvent;` |  | Event handler signalled when an object is dropped onto the control.
`property OnDragOver: TDragOverEvent;` |  | Event handler signalled when a control is dragged over the control instance.
`property OnEndDock: TEndDragEvent;` |  | Event handler signalled for the end of a drag-dock operation.
`property OnEndDrag: TEndDragEvent;` |  | Event handler signalled for the end of a drag-drop operation.
`property OnEnter: TNotifyEvent;` |  | Event handler signalled when the control receives focus.
`property OnExit: TNotifyEvent;` |  | Event handler signalled when the control loses focus.
`property OnGetImageIndex: TTabGetImageEvent;` |  | Event handler signalled to get the image index for a tab on the tabbed control.
`property OnGetSiteInfo: TGetSiteInfoEvent;` |  | Provides information about the DockSite for the control.
`property OnMouseDown: TMouseEvent;` |  | Event handler signalled when a mouse down event is handled for the control.
`property OnMouseEnter: TNotifyEvent;` |  | Event handler signalled when the mouse pointer has entered the control.
`property OnMouseLeave: TNotifyEvent;` |  | Event handler signalled when the mouse pointer has left the control.
`property OnMouseMove: TMouseMoveEvent;` |  | Event handler signalled when the mouse pointer is moved in the control.
`property OnMouseUp: TMouseEvent;` |  | Event handler signalled when a mouse up event is handled for the control.
`property OnMouseWheel: TMouseWheelEvent;` |  | Event handler for mouse wheel turned.
`property OnMouseWheelDown: TMouseWheelUpDownEvent;` |  | Event handler signalled for a downward movement of the mouse wheel.
`property OnMouseWheelUp: TMouseWheelUpDownEvent;` |  | Event handler signalled for an upward movement of the mouse wheel.
`property OnResize: TNotifyEvent;` |  | Notification handler for a resize of the control.
`property OnStartDock: TStartDockEvent;` |  | Event handler for the start of a docking operation.
`property OnStartDrag: TStartDragEvent;` |  | Event handler signalled for the start of a dragging operation.
`property OnUnDock: TUnDockEvent;` |  | Event handler signalled before a control is undocked from its DockSite.
`end;`

## Inheritance

`TPageControl` |  | Implements a multi-page component with a series of tabs.
`TCustomTabControl` |  | Implements the base class for tabbed controls in the LCL.
`TWinControl` |  | Implements a windowed control which can contain other child controls.
`TControl` |  | The base class for visible controls.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

TPageControl provides a series of tabs along an edge of a multi-page component to allow selection of one of the pages (TTabSheet) defined for the component.

To use TPageControl, select its icon from the Common Controls tab of the IDE Component Palette and place it at the desired location on the Form.

Use the Form Designer and Object Inspector to adjust its shape, size, alignment, anchoring, docking and other properties, then select the object and right click with the mouse to bring up a pop-up menu whose first item is 'AddPage'. After you have added as many pages as you need, the individual pages can be edited by selecting ActivePage in the Object Inspector choosing the page required and editing its properties.

While a given page is selected, it is also possible to drop other controls (such as buttons, memo boxes etc) onto the page from the Component Palette.

Inherits most of its properties from TCustomTabControl

## See also

Using Multi-Page Controls |  | MultiPageControls - controls that offer a selection of alternative pages for display.