Live Chat Icon For mobile
Live Chat Icon

How can I set the text as ‘Completed’ in a progress bar at the end of progress?

Platform: WPF| Category: ProgressBar

This can be done using the code given below.


        <Page xmlns=''
    xmlns:x='' >
            <!-- For demonstration purposes, animate ProgressBar.Value -->
                <EventTrigger RoutedEvent=’Page.Loaded’>
                        <Storyboard TargetName=’ProgressBar’ TargetProperty=’Value’>
                            <DoubleAnimation From=’0’ To=’100’ Duration=’0:0:1’ />
            <Grid Height='30' >
                <ProgressBar Name=’ProgressBar’ />
          <Style TargetType=’TextBlock’>
            <!-- Make the text 'Loading ...' by default-->
            <Setter Property=’Text’ Value=’Loading ...’ />          
            <!-- But when ProgressBar.Value is 100, change the text to 'Complete' -->
              <DataTrigger Binding=’{Binding Value, ElementName=ProgressBar}’ Value=’100’>
                <Setter Property=’Text’ Value=’Complete’ />

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.