From Free Pascal wiki
Jump to navigationJump to search

English (en) français (fr) русский (ru)

tcoolbar 150.png TCoolBar is a visible component on the Common Controls tab of the Component Palette that provides a (multiline) adjustable container for other controls, usually toolbars. The controls are arranged in rows and can be adjusted in size and position.

Getting started

Drop a TCoolbar on the form. It automatically aligns itself to the top of the form.

Adding controls to the coolbar

The coolbar is the container of toolbars, but any other controls can be added as well.

To add a control drop it from the component palette on the coolbar. Each dropped controls is assigned to a TCoolband instance inside the coolbar. At the left side of each coolband there is a grip which can be used to reposition the control. Alternatively, if the controls already exists outside the coolbar, drag its node in the object tree (above the object inspector) slightly below the node of the coolbar and drop it when the insertion line appears, or manually add an item to the Bands property in the object inspector and assign the control to the Control property of the band.

Set the coolbar's AutoSize to true to adjust the size of the coolbar to the size and number of the bands.

Dragging controls

By default the band of each dropped control extends over the full width of the coolbar and occupies an individual row.

You can rearrange the controls in the coolbar by grabbing them at the grip and dragging the grip, and the control along with it, to another location. Wherever the "drag" cursor appears you can drop the control at this new location. This way you can move the controls into a single row, or conversely, drag specific controls out of such a shared row into separate rows. Note that the latter task is a bit difficult: you must drag the mouse outside to entire coolbar, but not too far so that the "do not drop" cursor appears - in this case you cannot drop the control any more even if you move the mouse back.

When the FixedSize property of the bands (and of the coolbar) is false you can also change the width of the previous band in the same way. Here a "split" cursor appear to indicate this operation. You can still move the the control to a different location, but you must grab the band at the right of the grip so that the "split" cursor disappears. This may be a bit difficult to find, and it is probably easier to turn this feature off (FixedSize = true) if your main intention is to reposition controls.


Here is a list of the most important properties:


  • FixedOrder: boolean -- When this property is true it is not possible to rearrange the bands by dragging.
  • FixedSize: boolean -- When this property is true is is not possible to resize the bands by dragging.
  • GrabStyle: TGrabStyle = (gsSimple, gsDouble, gsHorLines, gsVerLines, gsGripper, gsButton) -- Defines the appearance of the band grip.
  • GrabWidth: Integer -- This is the width, in pixels, reserved for the band grip at the left of the control in the band.


  • Break: boolean -- When this is true the band begins a new row in the coolbar, otherwise the band is put in the same row as the previous band, provided that there is enough space for it. The value that you select in the object inspector is for the initial setup only. Later at runtime, Break will change when you drag controls to other locations: the first band in a row will have Break=true, all others will be switched to false.
  • FixedSize: boolean -- When this is true dragging of the band grip pimarily changes the width of the previous band. It is still possible to reposition the band, but it requires some exercise to find the correct point where dragging can be initiated. When the coolbar's FixedSize is true no band can be resized no matter what its individual FixedSize setting is.
  • MinHeight: Integer -- Is the minimum height of the band. Usually, however, the height of the band normally is determined by the height of the control in it. When several bands are arranged in the same row the row height is defined by the highest band.
  • MinWidth: Integer -- When the control in the band is smaller than this property value the control is autosized to this width. Conversely, when the control is wider than MinWidth the band expands to the control's width.
  • Visible: boolean -- Allows you to hide a band (and the associated control) by switching this property to false. When a band is hidden this way the following bands will move and fill the gap.

See also

LCL Components
Component Tab Components
Standard TMainMenu • TPopupMenu • TButton • TLabel • TEdit • TMemo • TToggleBox • TCheckBox • TRadioButton • TListBox • TComboBox • TScrollBar • TGroupBox • TRadioGroup • TCheckGroup • TPanel • TFrame • TActionList
Additional TBitBtn • TSpeedButton • TStaticText • TImage • TShape • TBevel • TPaintBox • TNotebook • TLabeledEdit • TSplitter • TTrayIcon • TControlBar • TFlowPanel • TMaskEdit • TCheckListBox • TScrollBox • TApplicationProperties • TStringGrid • TDrawGrid • TPairSplitter • TColorBox • TColorListBox • TValueListEditor
Common Controls TTrackBar • TProgressBar • TTreeView • TListView • TStatusBar • TToolBar • TCoolBar • TUpDown • TPageControl • TTabControl • THeaderControl • TImageList • TPopupNotifier • TDateTimePicker
Dialogs TOpenDialog • TSaveDialog • TSelectDirectoryDialog • TColorDialog • TFontDialog • TFindDialog • TReplaceDialog • TTaskDialog • TOpenPictureDialog • TSavePictureDialog • TCalendarDialog • TCalculatorDialog • TPrinterSetupDialog • TPrintDialog • TPageSetupDialog
Data Controls TDBNavigator • TDBText • TDBEdit • TDBMemo • TDBImage • TDBListBox • TDBLookupListBox • TDBComboBox • TDBLookupComboBox • TDBCheckBox • TDBRadioGroup • TDBCalendar • TDBGroupBox • TDBGrid • TDBDateTimePicker
Data Access TDataSource • TCSVDataSet • TSdfDataSet • TBufDataset • TFixedFormatDataSet • TDbf • TMemDataset
System TTimer • TIdleTimer • TLazComponentQueue • THTMLHelpDatabase • THTMLBrowserHelpViewer • TAsyncProcess • TProcessUTF8 • TProcess • TSimpleIPCClient • TSimpleIPCServer • TXMLConfig • TEventLog • TServiceManager • TCHMHelpDatabase • TLHelpConnector
Misc TColorButton • TSpinEdit • TFloatSpinEdit • TArrow • TCalendar • TEditButton • TFileNameEdit • TDirectoryEdit • TDateEdit • TTimeEdit • TCalcEdit • TFileListBox • TFilterComboBox • TComboBoxEx • TCheckComboBox • TButtonPanel • TShellTreeView • TShellListView • TXMLPropStorage • TINIPropStorage • TJSONPropStorage • TIDEDialogLayoutStorage • TMRUManager • TStrHolder
LazControls TCheckBoxThemed • TDividerBevel • TExtendedNotebook • TListFilterEdit • TListViewFilterEdit • TLvlGraphControl • TShortPathEdit • TSpinEditEx • TFloatSpinEditEx • TTreeFilterEdit • TExtendedTabControl •
RTTI TTIEdit • TTIComboBox • TTIButton • TTICheckBox • TTILabel • TTIGroupBox • TTIRadioGroup • TTICheckGroup • TTICheckListBox • TTIListBox • TTIMemo • TTICalendar • TTIImage • TTIFloatSpinEdit • TTISpinEdit • TTITrackBar • TTIProgressBar • TTIMaskEdit • TTIColorButton • TMultiPropertyLink • TTIPropertyGrid • TTIGrid
SQLdb TSQLQuery • TSQLTransaction • TSQLScript • TSQLConnector • TMSSQLConnection • TSybaseConnection • TPQConnection • TPQTEventMonitor • TOracleConnection • TODBCConnection • TMySQL40Connection • TMySQL41Connection • TMySQL50Connection • TMySQL51Connection • TMySQL55Connection • TMySQL56Connection • TMySQL57Connection • TSQLite3Connection • TIBConnection • TFBAdmin • TFBEventMonitor • TSQLDBLibraryLoader
Pascal Script TPSScript • TPSScriptDebugger • TPSDllPlugin • TPSImport_Classes • TPSImport_DateUtils • TPSImport_ComObj • TPSImport_DB • TPSImport_Forms • TPSImport_Controls • TPSImport_StdCtrls • TPSCustomPlugin
SynEdit TSynEdit • TSynCompletion • TSynAutoComplete • TSynMacroRecorder • TSynExporterHTML • TSynPluginSyncroEdit • TSynPasSyn • TSynFreePascalSyn • TSynCppSyn • TSynJavaSyn • TSynPerlSyn • TSynHTMLSyn • TSynXMLSyn • TSynLFMSyn • TSynDiffSyn • TSynUNIXShellScriptSyn • TSynCssSyn • TSynPHPSyn • TSynTeXSyn • TSynSQLSyn • TSynPythonSyn • TSynVBSyn • TSynAnySyn • TSynMultiSyn • TSynBatSyn • TSynIniSyn • TSynPoSyn
Chart TChart • TListChartSource • TRandomChartSource • TUserDefinedChartSource • TCalculatedChartSource • TDbChartSource • TChartToolset • TChartAxisTransformations • TChartStyles • TChartLegendPanel • TChartNavScrollBar • TChartNavPanel • TIntervalChartSource • TDateTimeIntervalChartSource • TChartListBox • TChartExtentLink • TChartImageList
IPro TIpFileDataProvider • TIpHtmlDataProvider • TIpHttpDataProvider • TIpHtmlPanel
Virtual Controls TVirtualDrawTree • TVirtualStringTree • TVTHeaderPopupMenu