#1,020 – Displaying Tick Marks on a Slider

If you want to display tick marks on a Slider, you set the TickPlacement property to indicate where you want the tick marks to appear:

  • None – don’t display tick marks  (default)
  • BottomRight – display below horizontal Slider, to the right of vertical Slider
  • TopLeft – display above horizontal Slider, to the left of vertical Slider
  • Both – display on both sides of Slider

In the example below, we set up tick marks every 5 units.  Because the Minimum value of the Slider is 1, this places them at 1, 6, 11, 16, etc.

        <Slider Name="mySlider" Margin="10"
                Minimum="1" Maximum="100"
                TickFrequency="5" IsSnapToTickEnabled="True"