Calculate ProgressBar Circular Time C # (Windows Forms)

0

I have the following ProgressBar circular, the idea is that it be decremented second by second, so far so good. However, I need the bar to start always full (circling 100%) and the value will be given by the user, so it can be 120 minutes, 90 minutes, and so on ... I want to make the bar decrease with the exact time it will take to arrive in 0 minutes.

For example, if the user enters the value 26 minutes, the bar must take exactly 26 minutes to reach 0.

Any ideas how to do this exact calculation?

Note: I'm using Timer.

    
asked by anonymous 04.11.2017 / 15:55

1 answer

1

Simple, set the range from timer to 1 second.

Assign the value of progressBar to [minutos escolhido pelo usuário] * 60

Each% of% of% of% of% decrements a value of tick

    
04.11.2017 / 19:48