Slider.TickFrequency Property

Gets or sets the interval between tick marks.

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

public double TickFrequency { get; set; }
/** @property */
public double get_TickFrequency ()

/** @property */
public void set_TickFrequency (double value)

public function get TickFrequency () : double

public function set TickFrequency (value : double)

<object TickFrequency="double" .../>

Property Value

The distance between tick marks. The default value is (1.0).

Identifier field


Metadata properties set to true


If the Ticks property is set to a value that is not a null reference (Nothing in Visual Basic), the TickFrequency property is not used.

The TickPlacement property must be set to a value other than None for tick marks to appear along the Slider.

Tick marks are drawn at an interval that is specified by the TickFrequency property The ticks marks start at the value of the Minimum property and continue until the value of the Maximum property is reached.

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

<Slider Width="100" Value="2" Orientation="Horizontal" HorizontalAlignment="Left" 
IsSnapToTickEnabled="True" Maximum="3" TickPlacement="BottomRight" 
AutoToolTipPlacement="BottomRight" AutoToolTipPrecision="2" 
Ticks="0, 1.1, 2.5, 3" IsSelectionRangeEnabled="true"
SelectionStart="1.1" SelectionEnd="3" Name="mySlider"/>

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

Community Additions