Dela via


Slider.TickFrequency Property

Definition

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

public:
 property double TickFrequency { double get(); void set(double value); };
double TickFrequency();

void TickFrequency(double value);
public double TickFrequency { get; set; }
var double = slider.tickFrequency;
slider.tickFrequency = double;
Public Property TickFrequency As Double
<Slider TickFrequency="double" />

Property Value

Double

double

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

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" />

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.

Applies to

See also