RepositoryItemTrackBar.BeforeShowValueToolTip Event
Allows you to provide custom tooltips for the thumb(s).
Namespace: DevExpress.XtraEditors.Repository
Assembly: DevExpress.XtraEditors.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
[DXCategory("Events")]
public event TrackBarValueToolTipEventHandler BeforeShowValueToolTip
Event Data
The BeforeShowValueToolTip event's data class is DevExpress.XtraEditors.TrackBarValueToolTipEventArgs.
Remarks
You can enable tooltips for the control’s thumb(s) via the RepositoryItemTrackBar.ShowValueToolTip property. By default, tooltips only display the current value. To provide custom tooltips for the thumb (for example, to format the value in a specific manner), handle the BeforeShowValueToolTip event. While handling this event, the custom tooltip must be assigned to the event’s ShowArgs.ToolTip parameter.
Example
The following code shows how to implement custom tooltips for a TrackBarControl’s thumb.
To enable tooltips, the RepositoryItemTrackBar.ShowValueToolTip property is set to true. Custom tooltips are implemented via the TrackBarControl.BeforeShowValueToolTip event. The result is shown below:
trackBarControl1.Properties.ShowValueToolTip = true;
//...
private void trackBarControl1_BeforeShowValueToolTip(
object sender, DevExpress.XtraEditors.TrackBarValueToolTipEventArgs e) {
e.ShowArgs.ToolTip = string.Format("Value = {0}", trackBarControl1.Value);
}