wpf 进度条ProgressBar配文字

效果

实现代码

<Grid>
    <ProgressBar Value="50" Name="pbStatus"/>
    <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding ElementName=pbStatus, Path=Value, StringFormat={}{0:0}%}"></TextBlock>
</Grid>

示例代码

ProcessBarWithTextWindow

参考资料

Text on a ProgressBar in WPF

原文地址:https://www.cnblogs.com/Lulus/p/13025976.html