Slider.AutoToolTipPrecision Property

Gets or sets the number of digits that are displayed to the right side of the decimal point for the Value of the Slider in a tooltip.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

public int AutoToolTipPrecision { get; set; }
/** @property */
public int get_AutoToolTipPrecision ()

/** @property */
public void set_AutoToolTipPrecision (int value)

public function get AutoToolTipPrecision () : int

public function set AutoToolTipPrecision (value : int)

<object AutoToolTipPrecision="int" .../>

Property Value

The precision of the Value that displays in the tooltip, specified as the number of digits that appear to the right of the decimal point. The default is zero (0).

Identifier field


Metadata properties set to true


Exception typeCondition


AutoToolTipPrecision is set to a value other than a non-negative integer.

The value of this property must be a non-negative integer. If this property is set to a value other than a non-negative integer, an exception occurs.

The following example shows how to set the AutoToolTipPrecision property. For the complete sample, see Slider Sample.

<Slider Name="slider1" Width="100" 
        Orientation="Horizontal" HorizontalAlignment="Left" 
        IsSnapToTickEnabled="True" Minimum="1" Maximum="9" 
        TickPlacement="BottomRight"  TickFrequency="3"
        AutoToolTipPrecision="2" AutoToolTipPlacement="BottomRight"

Slider hslider = new Slider();
hslider.Orientation = Orientation.Horizontal;
hslider.AutoToolTipPlacement =
hslider.AutoToolTipPrecision = 2;
hslider.IsDirectionReversed = true;
hslider.Width = 100;
hslider.IsMoveToPointEnabled = false;
hslider.SelectionStart = 1.1;
hslider.SelectionEnd = 3;
hslider.IsSelectionRangeEnabled = false;
hslider.IsSnapToTickEnabled = false;
hslider.TickFrequency = 3;
hslider.TickPlacement = TickPlacement.Both;

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0