Dec 31, 2014 02:49 AM
(This post was last modified: Dec 31, 2014 04:20 AM by Nikey646.)
Not sure if something like this has ever been released before, but decided to released a Gradient Based Progress Bar, which has some Text on it.
Screenshot:
![[Image: b02f87754d.png]](https://puu.sh/dT1L1/b02f87754d.png)
Public Properties that are Handled:
Maximum, Minimum, Value, ShowText, Text, Font, StartColor (Gradient), FinishColor (Second Color, Gradient), foreColor, BackColor
Public Subs/Events:
Increment(), Increment(Int32)
Source:
C#: http://pastebin.com/duxu5BGN
VB: http://pastebin.com/1jQm2u0L
Example Project [No Executables][C#/VB]:
Download: Mega
Credits:
Helper.ValueToPercentage -> Taken from one of LordPankake's Themes
Helper.CenterString -> Taken from AeroRev9's Genesis Theme, and Modified
Layout of the ProgressBar Control -> AeroRev9's Genesis Theme (Again :P)
Notes:
Use a hack-y fix to prevent an OutOfMemory exception (Which should be an InvalidArgumentException), due to a 0-0 width LinearGradientBrush.
Functionality > Style in this release :P
Inherits from Control
Helper.MultiDispose in C# doesn't check to see if the LinearGradientBrush is null
Helper.CenterString in C# moves the text 1 pixel higher...should probs fix that.
Edit: Forgot to mention some fun things that can be done.
If you change the LinearGradientBrush, so that rather then using the Value of the Progress bar, it went 0-1 for width, and 0-Height for height, it would make a vertical gradient.
With enough persistance, i'm sure it's more then possible to make a Gradient on a 45 degree angle, which combines the current value and the height. Mix that with a 3 Color Gradient to give it a shine in the middle going across, and it could look quite good!
Screenshot:
![[Image: b02f87754d.png]](https://puu.sh/dT1L1/b02f87754d.png)
Public Properties that are Handled:
Maximum, Minimum, Value, ShowText, Text, Font, StartColor (Gradient), FinishColor (Second Color, Gradient), foreColor, BackColor
Public Subs/Events:
Increment(), Increment(Int32)
Source:
C#: http://pastebin.com/duxu5BGN
VB: http://pastebin.com/1jQm2u0L
Example Project [No Executables][C#/VB]:
Download: Mega
Credits:
Helper.ValueToPercentage -> Taken from one of LordPankake's Themes
Helper.CenterString -> Taken from AeroRev9's Genesis Theme, and Modified
Layout of the ProgressBar Control -> AeroRev9's Genesis Theme (Again :P)
Notes:
Use a hack-y fix to prevent an OutOfMemory exception (Which should be an InvalidArgumentException), due to a 0-0 width LinearGradientBrush.
Functionality > Style in this release :P
Inherits from Control
Helper.MultiDispose in C# doesn't check to see if the LinearGradientBrush is null
Helper.CenterString in C# moves the text 1 pixel higher...should probs fix that.
Edit: Forgot to mention some fun things that can be done.
If you change the LinearGradientBrush, so that rather then using the Value of the Progress bar, it went 0-1 for width, and 0-Height for height, it would make a vertical gradient.
With enough persistance, i'm sure it's more then possible to make a Gradient on a 45 degree angle, which combines the current value and the height. Mix that with a 3 Color Gradient to give it a shine in the middle going across, and it could look quite good!

