Text on a ProgressBar in WPF

前端 未结 7 1166
日久生厌
日久生厌 2021-02-01 12:09

This may be a no-brainer for the WPF cognoscenti, but I\'d like to know if there\'s a simple way to put text on the WPF ProgressBar. To me, an empty progress bar looks naked. Th

7条回答
  •  闹比i
    闹比i (楼主)
    2021-02-01 13:02

    This can be very simple (unless there are alot of ways getting this to work).

    You could use Style to get this done or you just overlay a TextBlock and a ProgressBar.

    I personally use this to show the percentage of the progress when waiting for completion.

    To keep it very simple I only wanted to have one Binding only, so I attached the TextBock.Text to the ProgressBar.Value.

                                               Then just copy the Code to get it done.

    
       
       
    
    

                                                    Here is how this could look like:

                                       

    Check out WPF Tutorial for the full post.

提交回复
热议问题