Set The Progress Bar Over 100% C#

Posted by PhaDaPhunk on Stack Overflow See other posts from Stack Overflow or by PhaDaPhunk
Published on 2011-11-24T17:29:11Z Indexed on 2011/11/24 17:51 UTC
Read the original article Hit count: 197

Filed under:
|
|

its my first time using a ProgressBar in c#. The idea is to use the ProgressBar as an health bar in a simple game. The thing is I think the bar's maximum value is 100% but i would like to give it a higher value like let's say 1000% or, not sure if it's possible, give the bar an integer value instead of a percentage.

    progressBar1.Increment(100);

This is where I initialize the health to 100points. Even if I use this syntax:

    progressBar1.Increment(1000);

And I subtract :

    progressBar1.Increment(-25);

The player is loosing 1/4 of is life as if he only had 100 Health Points. Any idea how I could change the maximum Bar value? Thanks in advance.

© Stack Overflow or respective owner

Related posts about c#

Related posts about oop