首页 > 代码库 > wpf silder进度条的样式模板,带有进度颜色显示

wpf silder进度条的样式模板,带有进度颜色显示

效果图:



只需在前台加上这段代码即可:

<UserControl.Resources>
<!--笔刷-->
        <LinearGradientBrush x:Key="SliderBackground"  StartPoint="0,0" EndPoint="0,1">
            <GradientStop Offset="0" Color="#59ccfc"/>
            <GradientStop Offset="0.5" Color="#00b3fe"/>
            <GradientStop Offset="1" Color="#59ccfc"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="SliderThumb"  StartPoint="0,0" EndPoint="0,1">
            <GradientStop Offset="0" Color="#FFD9D3E8"/>
            <!--<GradientStop Offset="1" Color="#dfdfdf"/>-->
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="SliderText"  StartPoint="0,0" EndPoint="0,1">
            <GradientStop Offset="0" Color="#7cce45"/>
            <GradientStop Offset="1" Color="#4ea017"/>
        </LinearGradientBrush>

        <!--Slider模板-->
        <Style x:Key="Slider_RepeatButton" TargetType="RepeatButton">
            <Setter Property="Focusable" Value=http://www.mamicode.com/"false" />>

在这里添加进度条的样式:

<Grid>
        <Slider  Style="{StaticResource Slider_CustomStyle}"  />

 </Grid>

wpf silder进度条的样式模板,带有进度颜色显示