【问题标题】:how I put image on progress bar?我如何将图像放在进度条上?
【发布时间】:2013-03-18 07:10:52
【问题描述】:

我放了进度条,但它看起来不正确

<ProgressBar Height="30" Width="300"  VerticalAlignment="Center" BorderThickness="0" HorizontalAlignment="Center" Foreground="#0A8098" BorderBrush="Transparent"  Name="pbProcessing" >
                    <ProgressBar.Background>
                        <ImageBrush ImageSource="/ClientApplication;component/Images/ProgressBackground.png"/>
                    </ProgressBar.Background>
                    <ProgressBar.Clip>
                        <RectangleGeometry RadiusX="20.5" RadiusY="20.5" Rect="0,0,300,19"/>
                    </ProgressBar.Clip>
                </ProgressBar>

但我展示了

知道如何将图像完美地放在进度条上吗?谢谢。

【问题讨论】:

    标签: wpf progress-bar wpf-4.0


    【解决方案1】:

    试试这个

    <ProgressBar Value="30" Height="30" Width="300"  VerticalAlignment="Center"    BorderThickness="0" HorizontalAlignment="Center" Foreground="#0A8098" BorderBrush="Transparent"  Name="pbProcessing" >
            <ProgressBar.Template>
                <ControlTemplate>
                <Grid>
                    <Image Name="PART_Track" Source="bird1.jpg"  Stretch="Fill"/>
                        <Rectangle Name="PART_Indicator"   
                            Fill="BlanchedAlmond"    
                            HorizontalAlignment="Left"/>
                    </Grid>
                </ControlTemplate>
            </ProgressBar.Template>
        </ProgressBar>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多