Fork me on GitHub

Slider

 Slider主要介绍几个属性:LargeChane,是slider移动的最大单位;Maximumslider的最大值;Minimumslider是最少值;Orientation和其他控年一样,是布局方向;SmallChangeslider移动的最少位;TickFrequencyslider是显示的刻度单位;TickPlacementslider的布局样式。Value是当前值。

<StackPanel 

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    x:Class="Slider_wcp.Pane1"

 <StackPanel.Resources>

    <Style x:Key="Triggers" TargetType="{x:Type Slider}">

      <Style.Triggers>

        <Trigger Property="Slider.IsMouseOver" Value="True">

          <Setter Property = "Background" Value="Green"/>

          <Setter Property = "IsSnapToTickEnabled" Value ="True"/>

          <Setter Property = "TickPlacement" Value ="TopLeft"/>

          <Setter Property = "TickFrequency" Value ="1"/>

                   <Setter Property="TickPlacement" Value="BottomRight"/>

        </Trigger>

      </Style.Triggers>

    </Style>

 

 </StackPanel.Resources>

 <Grid ShowGridLines ="false" Background ="White" Width="408" Height="107.923" >  

    <TextBlock Margin="10,10,253,38" Grid.Column="0" Grid.Row="0"

    FontSize="24">Slider </TextBlock>   

    <Slider Margin="10,0,0,3" Grid.Column="0"

     Width="258" Value="0" Orientation="Horizontal" HorizontalAlignment="Left"

    Style="{StaticResource Triggers}" VerticalAlignment="Bottom" Height="22" />

 

 </Grid>

</StackPanel>

posted @ 2007-05-07 13:48  桂素伟  阅读(905)  评论(0编辑  收藏  举报