Files
docs-desktop/dotnet-desktop-guide/framework/wpf/controls/how-to-customize-the-ticks-on-a-slider.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

2.0 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
How to: Customize the Ticks on a Slider 03/30/2017
TickBar [WPF]
Slider control [WPF], creating with TickBar
4fa694f2-a620-4b15-be78-5f4286f89361

How to: Customize the Ticks on a Slider

This example shows how to create a xref:System.Windows.Controls.Slider control that has tick marks.

Example

The xref:System.Windows.Controls.Primitives.TickBar displays when you set the xref:System.Windows.Controls.Slider.TickPlacement%2A property to a value other than xref:System.Windows.Controls.Primitives.TickPlacement.None, which is the default value.

The following example shows how to create a xref:System.Windows.Controls.Slider with a xref:System.Windows.Controls.Primitives.TickBar that displays tick marks. The xref:System.Windows.Controls.Slider.TickPlacement%2A and xref:System.Windows.Controls.Slider.TickFrequency%2A properties define the location of the tick marks and the interval between them. When you move the xref:System.Windows.Controls.Primitives.Thumb, tooltips display the value of the xref:System.Windows.Controls.Slider. The xref:System.Windows.Controls.Slider.AutoToolTipPlacement%2A property defines where the tooltips occur. The xref:System.Windows.Controls.Primitives.Thumb movements correspond to the location of the tick marks because xref:System.Windows.Controls.Slider.IsSnapToTickEnabled%2A is set to true.

The following example shows how to use the xref:System.Windows.Controls.Slider.Ticks%2A property to create tick marks along the xref:System.Windows.Controls.Slider at irregular intervals.

[!code-xamlSlider#4]

See also