
Untitled
By: a guest on
Jun 4th, 2012 | syntax:
None | size: 1.26 KB | hits: 9 | expires: Never
Access outdoor controls from classes - VB.NET
Public Class clsLayoutObject
Private tmrAnimation As New Timer
Public oID As UInteger
Public oName As String
Public oGraphic As New List(Of Image)
Public oMaxFrame As UInteger
Public oActiveFrame As UInteger
Public oFrameRate As UInteger = 100
Public oX As Integer, oY As Integer
Public oWidth As Integer, oHeight As Integer
Public oDepth As UInteger
Public oLocked As Boolean
Public oVisible As Boolean
Private tempActiveFrame As UInteger
Private Sub playAnimation()
AddHandler tmrAnimation.Elapsed, New ElapsedEventHandler(AddressOf animationPlayback)
tmrAnimation.Interval = oFrameRate
tmrAnimation.Start()
tempActiveFrame = oActiveFrame
End Sub
Private Sub animationPlayback()
--> frmmain.Workspace.Invalidate()
If oActiveFrame < oMaxFrame Then
oActiveFrame += 1
Else
oActiveFrame = 0
End If
End Sub
Private Sub animationPause()
tmrAnimation.Stop()
frmmain.Workspace.Invalidate()
End Sub
Private Sub animationStop()
oActiveFrame = tempActiveFrame
tmrAnimation.Stop()
frmmain.Workspace.Invalidate()
End Sub
End Class