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

# TTabControl

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

TTabControl - a series of Tabs along the edge of a display area; selection of a Tab governs the contents of the DisplayRect.

## Declaration

Source position: comctrls.pp line 799

`type TTabControl = class(TCustomTabControl)`
`protected`
`class procedure WSRegisterClass; override;` |  | Registers the class type with the widgetset.
`procedure SetOptions(); override;` |  | Sets the value for the Options property.
`procedure AddRemovePageHandle(); override;` |  | Not implemented in TTabControl. Page handles are not used.
`function CanChange; override;` |  | Indicates whether the tab control can update its Tabs property.
`function CanShowTab(); virtual;` |  | Indicates if the control can show the tab at the specified position.
`procedure Change; override;` |  | Changes the active tab for the control.
`procedure CreateWnd; override;` |  | Creates the Handle for the widgetset object and displays the selected tab and page.
`procedure DestroyHandle; override;` |  | Destroys the handle for the control and all child controls.
`procedure Notification(); override;` |  | Handles the notification when a component is added to or removed from the class instance.
`procedure SetDragMode(); override;` |  | Sets the value for the DragMode property.
`procedure SetTabIndex(); virtual;` |  | Sets the value for the TabIndex property.
`procedure UpdateTabImages;` |  | Calls the corresponding method in Tabs.
`procedure ImageListChange();` |  | Calls the corresponding method in Tabs.
`procedure DoSetBounds(); override;` |  | Updates the bounds for the control to the specified values.
`class function GetControlClassDefaultSize; override;` |  | Gets the default size for new instances of the class.
`procedure PaintWindow(); override;` |  | Updates the canvas handle and paints the control.
`procedure Paint; virtual;` |  | Paints the control to its Canvas using theme services.
`procedure AdjustDisplayRectWithBorder(); virtual;` |  | Adjust the specified display rectangle to use the size in Tabs.
`procedure AdjustClientRect(); override;` |  | Calls the AdjustDisplayRect method.
`function CreateTabNoteBookStrings; virtual;` |  | Creates the TTabControlNoteBookStrings instance used in Tabs.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`destructor Destroy; override;` |  | Destructor for the class instance.
`function IndexOfTabAt();` |  | Gets the position for the tab at the specified mouse coordinates.
`function GetHitTestInfoAt();` |  | Gets a set of hit test results for the specified mouse coordinates.
`function GetImageIndex(); override;` |  | Signals the OnGetImageIndex event handler to get an image for the specified tab index.
`function IndexOfTabWithCaption();` |  | Gets the ordinal position for the tab with the specified Caption.
`function TabRect();` |  | Gets the rectangle where the tab at the specified position is drawn.
`function RowCount;` |  | Gets the number of rows needed to render the Tabs on the control.
`procedure ScrollTabs();` |  | Scrolls the tabs on the control horizontally by the value specified in Delta.
`procedure BeginUpdate;` |  | Starts an update process for the control.
`procedure EndUpdate;` |  | Finishes an update process for the control.
`function IsUpdating;` |  | Indicates if there are unfinished updates for one of the Tabs on the control.
`property DisplayRect: TRect; [r]` |  | Display area for the tab control.
`published`
`property HotTrack: Boolean; [rw]` |  | 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; [rw]` |  | Indicates whether the caption on a tab can have multiple lines of text.
`property MultiSelect: Boolean; [rw]` |  | Indicates whether multiple tabs can be simultaneously selected on the tabbed control.
`property OnChange: TNotifyEvent; [rw]` |  | 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 OnGetImageIndex: TTabGetImageEvent;` |  | Event handler signalled to get the image index for a tab on the tabbed control.
`property OwnerDraw: Boolean; [rw]` |  | Reads and write the value for the OwnerDraw property in Tabs.
`property RaggedRight: Boolean; [rw]` |  | Enables or disables justified text in the captions for tabs on the control.
`property ScrollOpposite: Boolean; [rw]` |  | Indicates whether unused multi-line tabs are scrolled to the side opposite of the tab position.
`property Style: TTabStyle;` |  | Indicates the appearance or display style used for the tabs on the control.
`property TabPosition: TTabPosition;` |  | Indicates the edge where the tabs for the control are aligned.
`property TabHeight: SmallInt; [rw]` |  | Height in pixels for the tabs on the control.
`property TabIndex: Integer; [rw]` |  | Contains the ordinal position for the active Tab in the control.
`property Tabs: TStrings; [rw]` |  | Contains the list of pages accessible in the tabbed control.
`property TabStop: Boolean; [rw]` |  | Enables or disables navigation using the Tab key.
`property TabWidth: SmallInt; [rw]` |  | Width in pixels for the tabs on the control.
`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 BiDiMode: TBiDiMode;` |  | Indicates whether text controls use in bi-directional reading.
`property BorderSpacing: TControlBorderSpacing;` |  | Determines the inner and outer border spacing for this control.
`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 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 ShowHint: Boolean;` |  | Enables Hint display for the control.
`property TabOrder: TTabOrder;` |  | Indicates the navigation order for the control when the user presses the Tab or Shift+Tab key.
`property Visible: Boolean;` |  | Allows the control, and all of its children, to be displayed or hidden.
`property OnChangeBounds: TNotifyEvent;` |  | Event handler signalled when the Bounds for the control have been changed.
`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 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

`TTabControl` |  | TTabControl - a series of Tabs along the edge of a display area; selection of a Tab governs the contents of the DisplayRect.
`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

TTabControl - a series of Tabs along the edge of a display area; selection of a Tab governs the contents of the DisplayRect

Use TTabControl by selecting its icon from the Common Controls tab of the IDE Component Palette and placing it at the desired location on the Form. Use the Form Designer and Object Inspector to adjust its shape, size, alignment, anchoring and other properties. Tabs can be added or removed from the component by selecting it, then right-clicking with the mouse to get a pop-up menu whose first item is 'Add Tab'. Once created, the Tabs can be edited by selecting the Tabs entry in the Object Inspector and selecting the ellipsis (...) which will cause a pop-up String editor to appear. The tabs can be given new captions, moved up and down the list or removed altogether as required.

Each Tab has an Index (starting from 0) and this index can be used to specify an entry from Images for display in the DisplayRect.

## See also

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