继续聊WPF——进度条
- <span style="font-size:16px;">[TemplatePartAttribute(Name = "PART_Track", Type = typeof(FrameworkElement))]
- [TemplatePartAttribute(Name = "PART_Indicator", Type = typeof(FrameworkElement))]
- public class ProgressBar : RangeBase
- </span>

- <span style="font-size:16px;"> <LinearGradientBrush x:Key="g1" StartPoint="0,0" EndPoint="1,1">
- <GradientStop Color="Orange" Offset="0"/>
- <GradientStop Color="Yellow" Offset="0.5"/>
- <GradientStop Color="Orange" Offset="1"/>
- </LinearGradientBrush>
- <Style
- TargetType="{x:Type ProgressBar}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ProgressBar}">
- <Grid MinHeight="14" MinWidth="200">
- <Border
- Name="PART_Track"
- CornerRadius="20"
- BorderBrush="Black"
- BorderThickness="1" Background="#FF57C7C9" />
- <Border
- x:Name="PART_Indicator"
- CornerRadius="16"
- BorderBrush="Red"
- BorderThickness="1"
- HorizontalAlignment="Left" >
- <Border.Background>
- <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
- <GradientStop Color="Orange" Offset="0"/>
- <GradientStop Color="Yellow" Offset="0.5"/>
- <GradientStop Color="Orange" Offset="1"/>
- </LinearGradientBrush>
- </Border.Background>
- </Border>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </span>
窗体上放一个ProgressBar控件
- <span style="font-size:16px;"> <ProgressBar x:Name="progressBar" Margin="173,113.5,178.187,137" OverridesDefaultStyle="True" RenderTransformOrigin="0.5,0.5" Value="55">
- <ProgressBar.RenderTransform>
- <TransformGroup>
- <ScaleTransform/>
- <SkewTransform/>
- <RotateTransform/>
- <TranslateTransform/>
- </TransformGroup>
- </ProgressBar.RenderTransform>
- <ProgressBar.Foreground>
- <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#FF24EE27" Offset="0"/>
- <GradientStop Color="#FF5434AC" Offset="0.5"/>
- <GradientStop Color="#FFB371EA" Offset="1"/>
- </LinearGradientBrush>
- </ProgressBar.Foreground>
- </ProgressBar>
- </span>


继续聊WPF——进度条的更多相关文章
- WPF 进度条ProgressBar
今天研究了一下wpf的进度条ProgressBar 1.传统ProgressBar WPF进度条ProgressBar 这个控件,如果直接写到循环里,会死掉,界面会卡死,不会有进度.需要把进度条放到单 ...
- WPF进度条系列②旋转小圆圈
写在之前: 关于WPF的样式,我也是学习了很多朋友的文章才有了下面的东西,因为时间有些久远 & 备份的链接也都不在了. 所以,究竟是看过哪些文章,也是记不清楚了…… 请见谅. ------- ...
- C# WPF 进度条,根据读取数据显示进度条进度,根据Excel文件读取数据,进度条样式
后台代码: //导入 private void Border_MouseLeftButtonUp_2(object sender, MouseButtonEventArgs e) { var path ...
- wpf 进度条 下拉
<Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsof ...
- WPF进度条
ProgressBar控件与传统WinForm使用方法完全一样,我们只需关注: Minimum——最小值,默认为0: Maximum——最大值,默认为100. Value——当前值. 关键是它的控 ...
- WPF进度条系列①滑动小圆点
写在之前: 关于WPF的样式,我也是学习了很多朋友的文章才有了下面的东西,因为时间有些久远 & 备份的链接也都不在了. 所以,究竟是看过哪些文章,也是记不清楚了…… 请见谅. ------- ...
- WPF 进度条
//Create a Delegate that matches the Signature of the ProgressBar's SetValue method private delegate ...
- Photoshop和WPF双剑配合,打造炫酷个性的进度条控件
现在如果想打造一款专业的App,UI的设计和操作的简便性相当重要.UI设计可以借助Photoshop或者AI等设计工具,之前了解到WPF设计工具Expression Blend可以直接导入PSD文件或 ...
- WPF自定义控件第一 - 进度条控件
本文主要针对WPF新手,高手可以直接忽略,更希望高手们能给出一些更好的实现思路. 前期一个小任务需要实现一个类似含步骤进度条的控件.虽然对于XAML的了解还不是足够深入,还是摸索着做了一个.这篇文章介 ...
随机推荐
- 用户向导左右滑动页面实现之ViewPager
接着上一篇博客.上一篇博客是用ImageSwitcher实现用户向导功能,如今用ViewPager实现同样的功能. 直接看代码: 布局文件activity_main.xml <RelativeL ...
- Git是什么?
Git是目前世界上最先进的分布式版本控制系统(没有之一). Git有什么特点?简单来说就是:高端大气上档次! 那什么是版本控制系统? 如果你用Microsoft Word写过长篇大论,那你一定有这样的 ...
- Coder-Strike 2014
转载请注明出处,谢谢http://blog.csdn.net/ACM_cxlove? viewmode=contents by---cxlove Qualification Round 略 Ro ...
- 3n+1问题
#include <stdio.h> #include <math.h> // 算法竞赛的目标是编程对任意输入均得到正确的结果. // 请先独立完成,如果有困难可以翻阅本书代码 ...
- 洛谷 P3515 [ POI 2011 ] Lightning Conductor —— 决策单调性DP
题目:https://www.luogu.org/problemnew/show/P3515 决策单调性... 参考TJ:https://www.cnblogs.com/CQzhangyu/p/725 ...
- 此文章介绍vue-cli脚手架config目录下index.js配置文件
此配置文件是用来定义开发环境和生产环境中所需要的参数 关于注释 当涉及到较复杂的解释我将通过标识的方式(如(1))将解释写到单独的注释模块,请自行查看 上代码 // see http://vuejs- ...
- php多个进程写文件
多进程写文件function write_file($filename, $content){ $lock = $filename . '.lck'; $write_length = 0; while ...
- Cracking the Coding Interview 4.8
You are given a binary tree in which each node contains a value. Design an algorithm to print all pa ...
- 自学Python十一 Python爬虫总结
通过几天的学习与尝试逐渐对python爬虫有了一些小小的心得,我们渐渐发现他们有很多共性,总是要去获取一系列的链接,读取网页代码,获取所需内容然后重复上面的工作,当自己运用的越来越熟练之后我们就会尝试 ...
- Cannot find module 'crc'
这个时候你只需要打开你nodejs安装的目录,在其中执行 npm install crc(这里查什么模块(module)就安装什么模块).