Skip to main content
A newer version of this page is available. .

RepositoryItemTrackBar.Labels Property

Provides access to the collection of labels used within the current TrackBarControl.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v18.2.dll

Declaration

[DXCategory("Data")]
public virtual TrackBarLabelCollection Labels { get; }

Property Value

Type Description
DevExpress.XtraEditors.Repository.TrackBarLabelCollection

A TrackBarLabelCollection that stores all labels used within the current TrackBarControl.

Remarks

The Labels collection stores TrackBarLabel elements. These elements provide textual information about all TrackBarControl‘s ticks. Each label has two properties - the Label and Value properties. The Value property serves as label’s tag and stores an Int32 value, while the Label property stores text, which an end-user will see. A label’s text is visible to an end-user if the RepositoryItemTrackBar.ShowLabels property equals true.

You can access and modify the Labels collection manually in code. Alternatively, you can generate a TrackBarControl‘s labels automatically via the control’s smart tag and modify them in the built-in designer (see the figure below).

TrackBarControl Labels Designer

Ticks that are hidden due to the RepositoryItemTrackBar.TickFrequency property have corresponding labels as well. You can specify if these labels are still visible via the RepositoryItemTrackBar.ShowLabelsForHiddenTicks property.

Along with modifying the Labels collection, you can handle the TrackBarControl.CustomLabel event to pass the required info to each label. The TrackBarControl.CustomLabel event has the higher priority in a label display than the Labels collection.

See Also