Differences between multi-page controls
/File:PageControlsComparison.png
Example renderings of TPageControl and TTabControl with a TNotebook as a child control. TMemos added as examples (set to borderstyle bsNone, align alClient, font size 14).
/File:PageControlsComparison2.png
To emphasize the differences in outline rendering the TMemos have been shrunken in size. Also TPageControl tabs now have glyphs while the TTabControl does not support them.
Structure for the examples used. Note how TNotebook has only one content page (but could provide more) while the TTabControl has four tab buttons (independent controls). TPageControl has one TTabSheet for each page with the content being on the second one in this example.
Lazarus (as of version 3.6 at time of writing) provides TPageControl and separate TTabControl and TNotebook controls for multi-page use cases (as Delphi also does).
However, even though TNotebook and TTabControl can mimic the behavior and appearance of a TPageControl, there are differences between the controls, which this article will highlight upon.
Additionally there are the TExtendedNotebook and TExtendedTabControl on the LazControls tab, which will be handled in a separate section below.
TPageControl
TTabControl
TabSheet of TPageControl
TNotebook
TPage of TNotebook
Specialised controls
Lazarus additionally provides the components TExtendedNotebook and TExtendedTabControl in the LazControls tab. They are used in the Lazarus IDE itself, but are also available for own projects this way.
The main difference for the TExtendedTabControl is that it provides a wrapper for a TToolbar which is displayed right aligned on the tab header level.
The TExtendedNotebook however provides an integrated tab header again. In fact making it the same as a TPageControl. It even exposes TTabSheets and not TPage subpage elements. And also renders exactly like a TPageControl with visible borders around the subpages.
Workaround (as of Lazarus 3.6)
To have a consistent and clean rendering of the outline frame - or more precise: having no visible outline around the TPageControl - a TNotebook seems to be the way to go. To also have icons in the tab header, you cannot use a TTabControl though - but, you can "misuse" a TPageControl for that. In fact you have to resize the TPageControl in a way that just the header section is visible. Below that you place a TNotebook. Maybe combine both in a TPanel to make things easier. After that you can setup the icons to be used in the TPageControl and you need to add code that reacts on tab changes in the TPageControl and consequently activates the right page in the TNotebook.
From the Free Pascal wiki, page "Differences between multi-page controls", as the Internet Archive kept it on 2026-01-15, last changed on 2024-11-09. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.






