WPF 环形进度条
一、新建一个用户控件:
<UserControl x:Class="BeatfanControls.ProcessBars.CycleProcessBar1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BeatfanControls.ProcessBars"
mc:Ignorable="d" >
<Viewbox>
<Grid Width="34" Height="34">
<Path Name="myCycleProcessBar" Data="M17,3 A14,14 0 1 0 17.001,3 " Stroke="LightGray" StrokeThickness="3" Height="34" Width="34" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Path Name="myCycleProcessBar1" Data="M17,3 A14,14 0 0 1 16,3 " Stroke="Green" StrokeThickness="3" Height="34" Width="34" VerticalAlignment="Center" HorizontalAlignment="Center">
</Path>
<Label Name="lbValue" Content="50%" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="9" />
</Grid>
</Viewbox>
</UserControl>
using System;
using System.Collections.Generic;
using System

文章详细介绍了如何在WPF环境中创建一个自定义的环形进度条用户控件,通过使用Path和ArcSegment来绘制进度,同时提供了百分比显示功能。控件的填充颜色、进度和显示值可以通过属性进行设置。
最低0.47元/天 解锁文章
9521

被折叠的 条评论
为什么被折叠?



