Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

RepositoryItemTrackBar.Labels Property

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

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#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