Does anybody have a way to make text "in the progress bar" that will change colors as the progress bar progresses ;) ?
Thanx in advance,
Squirrelly1
Printable View
Does anybody have a way to make text "in the progress bar" that will change colors as the progress bar progresses ;) ?
Thanx in advance,
Squirrelly1
Here is a sample of how to do that using a picture box to make a progress bar.VB Code:
Option Explicit Private Sub DrawProgress(ByVal Value As Long, ByVal Max As Long) Dim strPercent As String Dim intPercent As Integer Dim intWidth As Integer Dim intHeight As Integer intPercent = (Value / Max) * 100 strPercent = intPercent & "%" intWidth = Picture1.TextWidth(strPercent) intHeight = Picture1.TextHeight(strPercent) With Picture1 .FillStyle = vbFSSolid .BackColor = vbWhite .ForeColor = vbBlue .DrawMode = vbCopyPen .CurrentX = (Picture1.ScaleWidth - intWidth) / 2 .CurrentY = (Picture1.ScaleHeight - intHeight) / 2 Picture1.Print strPercent .DrawMode = vbNotXorPen End With If intPercent > 0 Then Picture1.Line (-50, -50)-(Picture1.Width * intPercent / 100, Picture1.Height), vbBlue, BF Else Picture1.Line (-50, -50)-(Picture1.Width, Picture1.Height), vbWhite, BF End If Picture1.Refresh End Sub Private Sub Form_Load() Timer1.Interval = 50 Timer1.Enabled = True Picture1.AutoRedraw = True End Sub Private Sub Timer1_Timer() Static i As Integer Dim lngMax As Long lngMax = 250 If i > lngMax Then i = 0 End If DrawProgress i, lngMax i = i + 1 End Sub