Slider.TickFrequency property

Applies to Windows and Windows Phone

Gets or sets the increment of the value range that ticks should be created for.

Syntax


public double TickFrequency { get; set; }


<Slider TickFrequency="double" />

Property value

Type: System.Double [.NET] | float64 [C++]

The increment to create tick marks for. The default is 0.0.

Remarks

Set the TickFrequency property to specify at which values tick marks are drawn on a Slider. For example, if a Slider has Minimum of 0, Maximum of 20, and TickFrequency of 2, tick marks are placed at every other step value, starting at 0 and ending at 20.

The drawing of tick marks on a slider depends on both the TickFrequency and TickPlacement properties. In order for tick marks to be shown, you must set the TickFrequency property to a value greater than 0, and the TickPlacement property to a value other than None.

To prevent tick marks from being packed too densely, the Slider will only show tick marks that are a minimum of 20 pixels apart. If a combination of Slider size, value range, and tick frequency results in tick marks that are too close together, some tick marks are not shown.

When the SnapsTo property is set to Ticks, the TickFrequency property also specifies the interval between snap points.

Examples

Here's a slider with its TickFrequency set to 2 and its TickPlacement set to BottomRight.


<Slider x:Name="slider2"  
        Minimum="0" 
        Maximum="10"
        TickFrequency="2"
        TickPlacement="BottomRight"
        ValueChanged="slider2_ValueChanged" />


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

Slider
SliderSnapsTo
SnapsTo
StepFrequency
TickPlacement

 

 

Show:
© 2014 Microsoft