Back to Devexpress

RepositoryItemTrackBar.ShowValueToolTip Property

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemtrackbar-ea702bb1.md

latest3.2 KB
Original Source

RepositoryItemTrackBar.ShowValueToolTip Property

Gets or sets whether the track bar shows the current value in a tooltip when a user moves a thumb.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(false)]
[DXCategory("Behavior")]
public bool ShowValueToolTip { get; set; }
vb
<DefaultValue(False)>
<DXCategory("Behavior")>
Public Property ShowValueToolTip As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true if the track bar shows the current value in a tooltip when a user moves a thumb; otherwise, false.

|

Remarks

The default tooltip contains the current value. You can handle the RepositoryItemTrackBar.BeforeShowValueToolTip event to display a custom tooltip.

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:

csharp
trackBarControl1.Properties.ShowValueToolTip = true;
//...

private void trackBarControl1_BeforeShowValueToolTip(
object sender, DevExpress.XtraEditors.TrackBarValueToolTipEventArgs e) {
    e.ShowArgs.ToolTip = string.Format("Value = {0}", trackBarControl1.Value);
}
vb
TrackBarControl1.Properties.ShowValueToolTip = True
'...
Private Sub TrackBarControl1_BeforeShowValueToolTip(ByVal sender As _ 
System.Object, ByVal e As DevExpress.XtraEditors.TrackBarValueToolTipEventArgs) Handles _ 
TrackBarControl1.BeforeShowValueToolTip
    e.ShowArgs.ToolTip = String.Format("Value = {0}", TrackBarControl1.Value)
End Sub

See Also

BeforeShowValueToolTip

Value

ValueToolTipFormatString

RepositoryItemTrackBar Class

RepositoryItemTrackBar Members

DevExpress.XtraEditors.Repository Namespace