Unit 'ComCtrls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#lcl]

TTrackBar

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

TTrackBar: a device which allows the user to determine the value of a variable using a quasi-analog slider.

Declaration

Source position: comctrls.pp line 2768

type TTrackBar = class(TCustomTrackBar)

published

  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 BorderSpacing: TControlBorderSpacing;

  

Determines the inner and outer border spacing for this control.

  property Color: TGraphicsColor;

  

The background color of the control.

  property Constraints: TSizeConstraints;

  

Contains the minimum and maximum Width and Height for the control.

  property DragCursor: TCursor;

  

The cursor shape shown while the control is dragged.

  property DragMode: TDragMode;

  

Allows the user to drag the control.

  property Enabled: Boolean;

  

Determines whether the control reacts on mouse or keyboard input.

  property Font: TFont;

  

The font to be used for text display in this control.

  property Frequency: Integer;

  

Indicates the frequency of tick marks displayed for the control.

  property Hint: string;

  

The text to show in the Hint window for the control.

  property LineSize: Integer;

  

Increment applied to the slider position when an arrow key is pressed.

  property Max: Integer;

  

Maximum value or position for the track bar slider.

  property Min: Integer;

  

Minimum value or position for the track bar slider.

  property OnChange: TNotifyEvent;

  

Event handler signalled when the Position in the control has been changed.

  property OnChangeBounds: TNotifyEvent;

  

Event handler signalled when the Bounds of the control have been changed.

  property OnClick: TNotifyEvent;

  

Notification handler for mouse clicks.

  property OnContextPopup: TContextPopupEvent;

  

Invoked when a context-sensitive pop-up menu is requested.

  property OnDragDrop: TDragDropEvent;

  

This handler determines the action on an drop onto this control, in a drag-drop operation.

  property OnDragOver: TDragOverEvent;

  

Event handler for a control being dragged over this control.

  property OnEndDrag: TEndDragEvent;

  

Notification handler for the end of a drag operation.

  property OnEnter: TNotifyEvent;

  

Handler for control receiving the focus.

  property OnExit: TNotifyEvent;

  

Handler for control loosing the focus; This is a good place for checking the finished user input.

  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 for mouse movement within 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 for downward movement of mouse wheel.

  property OnMouseWheelUp: TMouseWheelUpDownEvent;

  

Event handler for upward movement of the mouse wheel.

  property OnMouseWheelHorz: TMouseWheelEvent;

  

Event handler for horizontal movements of the mouse wheel.

  property OnMouseWheelLeft: TMouseWheelUpDownEvent;

  

Event handler for left movements of the mouse wheel.

  property OnMouseWheelRight: TMouseWheelUpDownEvent;

  

Event handler for right movements of the mouse wheel.

  property OnKeyDown: TKeyEvent;

  

Handler for keyboard key pressed.

  property OnKeyPress: TKeyPressEvent;

  

Handler for a character entered by the user.

  property OnKeyUp: TKeyEvent;

  

Event handler signalled when a key up event has occurred for the control.

  property OnResize: TNotifyEvent;

  

Notification handler for a resize of the control.

  property OnStartDrag: TStartDragEvent;

  

Event handler for the start of a dragging operation.

  property OnUTF8KeyPress: TUTF8KeyPressEvent;

  

Handler for a character entered by the user.

  property Orientation: TTrackBarOrientation;

  

Indicates the horizontal or vertical orientation for the track bar control.

  property PageSize: Integer;

  

The increment for the slider position when PageUp or PageDown key is pressed.

  property ParentColor: Boolean;

  

Use the Color from the Parent control, when enabled.

  property ParentFont: Boolean;

  

If True, the Font of the control will be the same as the one from the Parent. Default is True.

  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 Position: Integer;

  

Location of the slider on the track bar between the Min and Max values.

  property Reversed: Boolean;

  

True if the values are displayed in ascending order from right-to-left.

  property ScalePos: TTrackBarScalePos;

  

Position where the scale is displayed.

  property SelEnd: Integer;

  

Ending value for the selection range in the track bar control.

  property SelStart: Integer;

  

Starting value for the selection range in the track bar control.

  property ShowHint: Boolean;

  

Enables Hint display for the control.

  property ShowSelRange: Boolean;

  

Displays a selection range and indicators using the values in SelStart and SelEnd.

  property TabOrder: TTabOrder;

  

Indicates the navigation order for the control when the user presses the Tab or Shift+Tab key.

  property TabStop: Boolean;

  

Enables or disables navigatiopn using the Tab key.

  property TickMarks: TTickMark;

  

Position for the tick marks relative to the slider in the track bar.

  property TickStyle: TTickStyle;

  

Indicates the tick mark drawing style for the control.

  property Visible: Boolean;

  

Allows the control, and all of its children, to be displayed or hidden.

end;

Inheritance

TTrackBar

  

TTrackBar: a device which allows the user to determine the value of a variable using a quasi-analog slider.

|

TCustomTrackBar

  

TCustomTrackBar - the base class for TTrackBar.

|

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.

|

TObject

Description

TTrackBar: a device which allows the user to determine the value of a variable using a quasi-analog slider.

The device looks like a slider-potentiometer control on a hi-fi amplifier and consists of a slider which can be moved along a bar using the mouse. Tick marks can be displayed along one or both edges, giving an indication of the proportion of the maximum value of the controlled variable that is being selected.

The Position property indicates the distance along the bar that the slider has been placed, either by the program or by mouse capture and movement.

In the example, movement of the slider is detected and shown in the associated TProgressBar.

See also

How To Use Standard Controls

  

How to use StdCtrls, ComCtrls or ExtCtrls.

Example

 
procedure TForm1.TrackBar1Change(Sender: TObject);
begin
  ProgressBar1.Position := (TrackBar1.Position)*10
end;