vcl-cxdbtrackbar.md
A data-aware track bar editor.
TcxDBTrackBar = class(
TcxCustomTrackBar
)
A simple track bar editor (TcxTrackBar/TcxDBTrackBar) uses a thumb to specify a numeric value.
You can arrange a track bar editor horizontally or vertically, flip the scale direction, and customize the appearance of scale, thumb, tick marks, and other track bar elements.
In this topic…
At design time, you can add a TcxDBTrackBar using the Component Palette in your RAD Studio IDE. To create and use TcxDBTrackBar components in code, add the cxDBTrackBar unit to the uses clause of your project (in Delphi) or include the cxDBTrackBar header in the source code file (in C++Builder).
Track bar editors (TcxCustomTrackBar descendants) support multiple mouse/touch and keyboard-based user interaction options.
Users can drag the thumb to modify the edit value.
In addition, a click on the track bar before or after the thumb changes its position in increments specified by the Properties.PageSize property value. If the Properties.ThumbStep property is set to cxtsJump, a click on the track bar moves the thumb directly to the target position.
If the track bar editor has focus, the following keys increment or decrement the edit value (depending on the Properties.ReverseDirection property value):
Page Up | Page DownIncrement/decrement the edit value by Properties.PageSize.→ | ↑ | ↓ | ← | + | -Increment/decrement the edit value by Properties.LineSize. These keys correspond to change buttons.
Users can rotate the mouse wheel to increment/decrement[1] the editor value when the following conditions are met:
True ( default )The list below outlines key members of the TcxDBTrackBar class. These members allow you to configure data-aware track bar editors.
Style | StyleDisabled | StyleFocused | StyleHot | StyleReadOnly
Allow you to define individual appearance settings for different track bar editor states.
Tip
To apply the same style settings to multiple editors, use a TcxEditStyleController component. If you need to apply the same style settings to all editors in your application, you can use a TcxDefaultEditStyleController component.
StylesProvides access to individual styles applied to the track bar editor in different states.TransparentSpecifies if the track bar editor is transparent in GDI render mode.
EditValueSpecifies the edit value.PositionSpecifies the track thumb position.
CanPostEditValueIdentifies if the track bar can post its edit value to the bound data storage.DataBindingAllows you to bind the track bar editor to data.OnPostEditValueAllows you to execute custom code when the track bar editor posts a value to the bound data storage.PostEditValuePosts the edit value to the bound data storage.
ActivePropertiesProvides access to the current track bar editor settings regardless of their source. This property set does not allow you to customize editor settings.PropertiesAllows you to customize track bar editor settings directly if the editor does not have an assigned repository item.RepositoryItemSpecifies a repository item as an external source of track bar editor settings. A repository item has priority over other editor settings.
AutoSizeSpecifies if the track bar editor automatically adjusts its size to fit all visible UI elements in full.EnabledSpecifies if the editor is enabled.CanModifyIdentifies if the editor is in read-only mode.ShowHintSpecifies if the track bar editor can display hints.Width | HeightAllow you to explicitly define editor dimensions.
You can create a TcxEditRepositoryTrackBar component in an edit repository to store track bar settings and share them across multiple editors.
To see the TcxTrackBar editor in action (the TcxDBTrackBar editor has the same user experience), run the Data Editors and Controls demo in the VCL Demo Center installed with compiled DevExpress VCL demos. Click Track Bar in the sidebar on the left to activate the corresponding demo.
Tip
You can find full source code for the installed compiled editor demo in the following folder:
_%PUBLIC%\Documents\DevExpress VCL Demos\MegaDemos\Product Demos\ExpressEditors_
TdxRangeTrackBarAn unbound range track bar editor.TdxZoomTrackBarAn unbound zoom track bar editor similar to the zoom slider found in Microsoft Office.
TdxDBRangeTrackBarA data-aware range track bar editor.TdxDBZoomTrackBarA data-aware zoom track bar editor similar to the zoom slider found in Microsoft Office.
Show 13 items
TObject TPersistent TComponent TControl TWinControl TCustomControl TcxCustomControl TcxControl TcxContainer TcxCustomEditContainer TcxCustomEdit TcxCustomTrackBar TcxDBTrackBar
Footnotes
True.See Also