-
Jun 18th, 2011, 12:07 AM
#1
Thread Starter
Lively Member
[RESOLVED] Custom ProgressBars / Fill Image
Hey all,
does anyone know how to go about using an image to 'fill' a progress bar instead of the stock standard green thing? I would also greatly appreciate a solution to using and image as the background of a progress bar aswell!
Thanks,
Josh
-
Jun 18th, 2011, 12:39 AM
#2
Re: Custom ProgressBars / Fill Image
Originally Posted by jduncanator
Hey all,
does anyone know how to go about using an image to 'fill' a progress bar instead of the stock standard green thing? I would also greatly appreciate a solution to using and image as the background of a progress bar aswell!
Thanks,
Josh
Wonder on over to Code Project for a nice progressbar that does allow among other things a background image. Build the project then add the control to your toolbox
To try it out place the control on a form, add a timer, use the code below which does an never-ending demo with text displayed in the control showing percent done.
Code:
Public Class Form1
Private CurrentPosition As Integer = 0
Private PositionValue As Integer = -1
Private Sub Form1_Load() Handles MyBase.Load
CurrentPosition = Progressbar1.Position
End Sub
Private Sub Timer1_Tick() Handles Timer1.Tick
If CurrentPosition = Progressbar1.PositionMax Then
PositionValue = -1
Else
If CurrentPosition = Progressbar1.PositionMin Then
PositionValue = 1
End If
End If
CurrentPosition += PositionValue
Progressbar1.Text = String.Concat(CurrentPosition.ToString(), " percent done")
Progressbar1.Position = CurrentPosition
End Sub
Private Sub Button1_Click() Handles Button1.Click
Timer1.Enabled = Not Timer1.Enabled
End Sub
End Class
Very easy to configure the UI in the IDE too.
http://www.codeproject.com/KB/cpp/XpProgressBar.aspx
-
Jun 18th, 2011, 02:07 AM
#3
Thread Starter
Lively Member
Re: Custom ProgressBars / Fill Image
I have seen this, but as the name states 'XP' I was sceptical about whether it would work on Vista and Win7?
Josh
-
Jun 18th, 2011, 09:00 AM
#4
Re: Custom ProgressBars / Fill Image
Originally Posted by jduncanator
I have seen this, but as the name states 'XP' I was sceptical about whether it would work on Vista and Win7?
Josh
I see no reason (after going thru the source code) why this progressbar would not work on Windows 7 as the code does nothing dependent on any one OS. I use it on Windows Vista, do not have Windows 7 to test it with.
-
Jun 22nd, 2011, 05:19 AM
#5
Thread Starter
Lively Member
Re: Custom ProgressBars / Fill Image
Thanks! The only reason I thought this might not work is the demo program didn't do anything, aswell as the new Aero and visual display effects differs from XP to Vista/7 but if it works in Vista it should theoretically work in Win7!
Thanks again,
Josh
-
Jun 22nd, 2011, 06:04 AM
#6
Re: Custom ProgressBars / Fill Image
Originally Posted by jduncanator
Thanks! The only reason I thought this might not work is the demo program didn't do anything, aswell as the new Aero and visual display effects differs from XP to Vista/7 but if it works in Vista it should theoretically work in Win7!
Thanks again,
Josh
It works fine on Vista, do not have Win7 so if it does not work I can not imagine it would take much to make the ProgressBar to work.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|