PrOpHeT
06-19-2006, 01:20 PM
I am using this
Private Sub ProgressTimerHandler(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs)
Static _Place As Double
Dim Rect As New Rectangle(CInt(_Place) - CInt((Progress.Width * 0.2)), Progress.Left - 9, CInt((Progress.Width * 0.2)), Progress.Height)
Dim Brush As New System.Drawing.Drawing2D.LinearGradientBrush(Rect, Color.LightBlue, Color.MidnightBlue, Drawing2D.LinearGradientMode.Horizontal)
Dim Painter As Graphics = Progress.CreateGraphics
Painter.FillRectangle(Brush, Rect)
If _Place > 0 Then
_Place -= 3
Else
_Place = Progress.Width + (Progress.Width * 0.2)
End If
End Sub
To produce a progressbar type effect on a picturebox, "Progress"
It works fine, but I would love to be able to reverse the gradient and have the effect of it bouncing back and forth. Any Ideas on how to reverse the gradient?
Private Sub ProgressTimerHandler(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs)
Static _Place As Double
Dim Rect As New Rectangle(CInt(_Place) - CInt((Progress.Width * 0.2)), Progress.Left - 9, CInt((Progress.Width * 0.2)), Progress.Height)
Dim Brush As New System.Drawing.Drawing2D.LinearGradientBrush(Rect, Color.LightBlue, Color.MidnightBlue, Drawing2D.LinearGradientMode.Horizontal)
Dim Painter As Graphics = Progress.CreateGraphics
Painter.FillRectangle(Brush, Rect)
If _Place > 0 Then
_Place -= 3
Else
_Place = Progress.Width + (Progress.Width * 0.2)
End If
End Sub
To produce a progressbar type effect on a picturebox, "Progress"
It works fine, but I would love to be able to reverse the gradient and have the effect of it bouncing back and forth. Any Ideas on how to reverse the gradient?