简体   繁体   中英

how to use progress bar in wpf popup control?

I am using C# and WPF for my GUI. My goal is to display a progress bar under the wpf popup control. I am using below code add a progress bar under the popup control.

<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>

Please Help me.

Thanx in advanced!

You should use below code for showing ProgressBar under the Popup control:

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM