#1,026 – Horizontal and Vertical Sliders

You can orient a Slider either horizontally or vertically by setting the Orientation property to Horizontal (the default) or Vertical.  The thumb on the Slider will be rendered differently, depending on the orientation.

Below is an example of both a horizontal and a vertical Slider.

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Label Content="Width" VerticalAlignment="Center"/>
            <Slider Grid.Column="1" Margin="10" Foreground="Blue"
                    Minimum="1" Maximum="5"
                    TickPlacement="BottomRight"/>
        </Grid>

        <Slider Grid.Row="1" Margin="10,0" Foreground="Blue"
                Minimum="1" Maximum="10"
                Orientation="Vertical"
                TickPlacement="BottomRight"/>
        <Label Grid.Row="2" Content="Height"/>
    </Grid>

1026-001

Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #1,026 – Horizontal and Vertical Sliders

  1. Pingback: Dew Drop – March 11, 2014 (#1740) | Morning Dew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: