One or Two Button Trackbar with Styles

From Free Pascal wiki


TrackBar2" is a trackbar component that can be configured in a broad range of different styles (colors, thumb styles, tick styles and so on) and can support either one or two thumb buttons. Where a one-button trackbar is used to define a value, a two-button track bar is useful in defining a range of values between a minimum and a maximum. I use two two-button trackbars (one vertical, one horizontal) do define a rectangular area of interest in a bitmap image.

This component is based on the tDCTrack one-button trackbar written by Doug Gregor and widely available on the internet.

The component has been tested under Windows (2000, XP) only.

The main characteristics of Trackbar2 are :

  • Use one or two thumb buttons.
  • Allows several different thumb button styles.
  • Allows several different tick mark styles.
  • Allows several different placement options for tick marks.
  • Allows different colors for ticks, track bar and thumb buttons.
  • Allows vertical and horizontal orientation.

The download contains the component source and a demo application that illustrates some of the features of the component. I have not included a package since I suspect that most users will want to define their own registration parameters by modifying the registration procedure in the source file.


Here is an exemple of several applications of Trackbar2.


This component is an extension of the work of Doug Gregor. I have adapted it to allow for two-button configurations.


modified LGPL (same as the FPC RTL and the Lazarus LCL). You can contact the author if the modified LGPL doesn't work with your project licensing.


The latest stable release can be found on link to the lazarus-ccr sf download location.

Change Log

  • Version 1.0 date

Dependencies / System Requirements

This component has been tested under Windows only. It uses Classes, Messages, Types, LCLType, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls;

Status: First release


Windows only as presented.


Modify the source to Install into the package of your choice using the standard Lazarus install procedure.

The My Component Example Application

This sample Trackbar.exe (for windows) will display a collection of one- and two-button trackbars that can be created using the component.