簡體   English   中英

如何在WPF彈出控件中使用進度條?

[英]how to use progress bar in wpf popup control?

我在GUI中使用C#和WPF。 我的目標是在wpf彈出控件下顯示進度條。 我正在使用下面的代碼在彈出控件下添加進度條。

<Popup HorizontalAlignment="Left" Margin="338,261,0,0" Name="popup1" VerticalAlignment="Top" Height="38" Width="153" >
            <StackPanel Background="Red">
                <ProgressBar Height="15" HorizontalAlignment="Left" Margin="349,272,0,0" Name="progressBar1" VerticalAlignment="Top" Width="130" Foreground="#FF3EA3EA" Value="{Binding ElementName=textBox1, Path=Text.Length, Mode=OneTime}"   Maximum="140" />

            </StackPanel>
        </Popup>

請幫我。

感謝高級!

您應該使用以下代碼在Popup控件下顯示ProgressBar

<Popup Name="popup1" HorizontalAlignment="Left" Margin="338,261,0,0" AllowsTransparency="True" VerticalAlignment="Top" Height="38" Width="153">
    <Grid>
        <ProgressBar HorizontalAlignment="Left"   
                     Name="progressBar1" Height="25" 
                     VerticalAlignment="Center" Width="130" 
                     Foreground="#FF3EA3EA" 
                     Value="{Binding ElementName=textBox1, Path=Text.Length, Mode=OneTime}"
                     Maximum="140" ForceCursor="False" />
    </Grid>
</Popup>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM