Slider in WPF using VB.NET

In this article you will learn how to work with Slider control in WPF.
  • 2151

Slider: The Slider is a specialized control that's occasionally useful. This control comes to simplify the process of coding for some UI design cases where you need to let your user choose a value and change it and you update your interface based on user's choices.

The core feature of slider is to displays a WPF slider control in a menu element along with child menu that specify individual values, and the range for the entire slider does not have to be linear. The range is only linear between individual slider tick stops.

The key Slider properties are defined in the RangeBase class. Along with these, you can use all the properties listed below:

  • Orientation

  • Delay and Interval

  • TickPlacement

  • TickFrequency

  • Ticks

  • IsSnapToTickEnabled

  • IsSelectionRangeEnabled

Example of an Slider control
XMAL Code

<Window x:Class="ClassicControls.SlidersCompared"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="SlidersCompared" Height="350" Width="450">
    <Grid>
        <StackPanel Margin="10">
            <TextBlock Margin="0,15,0,5">A Tick Mark Slider</TextBlock>
            <Slider Maximum="50" Value="15" TickFrequency="5"
                TickPlacement="BottomRight"></Slider>
        </StackPanel>
    </Grid>
</
Window>

Output window

slid.gif
 

Conclusion

Hope this article help you to understand the working of Slider control in WPF.

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.