Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 4th, 2012  |  syntax: None  |  size: 1.26 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Access outdoor controls from classes - VB.NET
  2. Public Class clsLayoutObject
  3.     Private tmrAnimation As New Timer
  4.  
  5.     Public oID As UInteger
  6.     Public oName As String
  7.     Public oGraphic As New List(Of Image)
  8.     Public oMaxFrame As UInteger
  9.     Public oActiveFrame As UInteger
  10.     Public oFrameRate As UInteger = 100
  11.     Public oX As Integer, oY As Integer
  12.     Public oWidth As Integer, oHeight As Integer
  13.     Public oDepth As UInteger
  14.     Public oLocked As Boolean
  15.     Public oVisible As Boolean
  16.  
  17.     Private tempActiveFrame As UInteger
  18.  
  19.     Private Sub playAnimation()
  20.         AddHandler tmrAnimation.Elapsed, New ElapsedEventHandler(AddressOf animationPlayback)
  21.         tmrAnimation.Interval = oFrameRate
  22.         tmrAnimation.Start()
  23.         tempActiveFrame = oActiveFrame
  24.     End Sub
  25.  
  26.     Private Sub animationPlayback()
  27.         --> frmmain.Workspace.Invalidate()
  28.         If oActiveFrame < oMaxFrame Then
  29.             oActiveFrame += 1
  30.         Else
  31.             oActiveFrame = 0
  32.         End If
  33.     End Sub
  34.  
  35.     Private Sub animationPause()
  36.         tmrAnimation.Stop()
  37.         frmmain.Workspace.Invalidate()
  38.     End Sub
  39.  
  40.     Private Sub animationStop()
  41.         oActiveFrame = tempActiveFrame
  42.         tmrAnimation.Stop()
  43.         frmmain.Workspace.Invalidate()
  44.     End Sub
  45. End Class