TTrackBar
Description
Provides a track bar control.
Remarks
Use TTrackBar to put a track bar on a form. A track bar represents a position along a continuum using a slider and, optionally, tick marks. A track bar can also display a selected range marked by triangular ticks at the starting and ending positions of the selection.
During script execution, the slider can be moved to the desired position by dragging it with the mouse or by clicking the mouse on the bar. To use the keyboard to move the slider, press the arrow keys or the PAGE UP and PAGE DOWN keys.
TTrackBar Properties
Property Frequency: Integer (R/W)
Specifies the increment between tick marks on the track bar. Use Frequency to specify the spacing of the tick marks, using the logical units used by the Position property. For example, a Frequency of 5 sets a tick mark at every fifth possible increment. To provide visual feedback about the units used by the track bar, set Frequency to LineSize or PageSize.
Note: If the value of the TickStyle property is not set to tsAuto, the value of Frequency is ignored.
Property LineSize: Integer (R/W)
Indicates the amount the value of Position changes when the user presses the arrow keys. Use LineSize to specify the distance along the slider that represents a single unit. The current Position is marked by a slider. The right and down arrow keys increment the value of Position by LineSize, and the left and up arrow keys decrement the value of Position by LineSize. Use the PageSize property to set the number of ticks moved using the Page Up and Page Down keys.
Property Min: Integer (R/W)
Specifies the minimum Position of a TTrackBar. Use Min to set a lower limit to the value that can be represented using the track bar. A slider indicates the current Position in a range between Min and Max.
Property Max: Integer (R/W)
Specifies the maximum Position of a TTrackBar. Use Max to set an upper limit to the value that can be represented using the track bar. A slider indicates the current Position in a range between Min and Max.
Property Orientation: Enumerated (R/W)
Specifies whether the track bar is horizontal or vertical. Set Orientation to the desired orientation of the track bar. Orientation has these possible values:
Value |
Meaning |
tbHorizontal |
The long edge of the track is parallel to the top of the form. The Min position is on the left and the Max position is on the right. |
tbVertical |
The long edge of the track is parallel to the side of the form. The Min position is on the top and the Max position is on the bottom. |
Property PageSize: Integer (R/W)
Specifies the amount Position is changed when the PageUp or PageDown key is pressed, or when the bar is clicked. Set PageSize to the distance along the track bar that corresponds to a single view. A slider marks the current Position. The Page Up key increments the value of Position by PageSize, and Page Down key decrements the value of Position by PageSize. Use the LineSize property to set the number of ticks moved using the arrow keys.
Property Position: Integer (R/W)
Contains the current position of the slider of a TTrackBar. Read Position to determine the current value represented by the track bar. Position is a value in the range between Min and Max (inclusive). Set Position to programmatically move the slider of the track bar to a new value.
Property SelEnd: Integer (R/W)
Specifies the position of the end point of the selection range. Set SelEnd to determine the length of a selection that begins at SelStart. The track bar indicates a selection range on the bar by placing special tick marks at the positions specified by the SelStart and SelEnd properties and highlighting the selected portion of the bar. SelEnd must be greater than or equal to Position. If SelEnd is set to a value less than Position, Position changes to SelEnd. SelEnd must be greater than or equal to SelStart. If SelEnd is the same as SelStart, there is no selection, and the value of Position is the same as SelStart and SelEnd.
Property SelStart: Integer (R/W)
Specifies the position of the starting point of the selection range. Set SelStart to determine the beginning of a selection that runs to SelEnd. The track bar indicates a selection range on the bar by placing special tick marks at the positions specified by the SelStart and SelEnd properties and highlighting the selected portion of the bar.
SelStart must be less than or equal to Position. If SelStart is set to a value greater than Position, Position changes to SelStart. SelStart must be less than or equal to SelEnd. If SelStart is the same as SelEnd, there is no selection, and the value of Position is the same as SelStart and SelEnd.
Property SliderVisible: Boolean (R/W)
Specifies whether the track bar's slider is visible. Use SliderVisible to get or set whether the track bar's slider is visible.
Property ThumbLength: Integer (R/W)
Specifies the length of the track bar's slider. Use ThumbLength to get or set the length of the track bar's slider.
Property TickMarks: Enumerated (R/W)
Specifies the location of the tick marks. Set TickMarks to specify where the tick marks should be drawn. TickMarks has these possible values:
Value |
Meaning |
tmBottomRight |
Tick marks are on the bottom or right of the track bar, depending of the value of Orientation. |
tmTopLeft |
Tick marks are on the top or left of the track bar, depending of the value of Orientation. |
tmBoth |
Tick marks are on both sides of the track bar. |
Note: If the TickStyle property is tsNone, the value of TickMarks is ignored.