Is it possible to animate the panel width for three seconds or depending on the number of seconds I pass on the method/function?
I'm currently using timer to change the width but it doesn't have specific number of seconds to finish the animation.
This is my current code:
Private Sub Button1_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick()
If Panel1.Width < 50 Then
Panel1.Width += 10
Else
Me.Dispose()
Timer1.Enabled = Flase
End If
End Sub
What i want is to have a function like this
Private Sub AnimateWidth(ByRef pnl As Panel, ByVal MaxWidth As Integer, ByVal NumberOfSeconds as Double)
'This is where I'm Lost. I dont have any idea what to do
End Sub
Interval
of theTimer
, which determines the number ofTick
events per second, and the number of pixels to move on eachTick
. You don't need help with determining which combinations of those two variables will give you the desired result.