home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / async / timeobj.cls < prev    next >
Encoding:
Visual Basic class definition  |  1998-09-12  |  1.5 KB  |  61 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "TimeObj"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = True
  8. Attribute VB_PredeclaredId = False
  9. Attribute VB_Exposed = True
  10. Option Explicit
  11.  
  12. ' ***************************************************
  13. ' This code is for a basic object containing an object
  14. ' property (the owner to notify when done), and methods
  15. ' for starting and stopping the async procedure.
  16. '
  17. ' In the TimeModule.Bas file is the main routine
  18. ' which you will need to modify to perform your desired
  19. ' behavior (TimeLoop).
  20. ' ***************************************************
  21.  
  22. Private mvarNotify As Object
  23. Private mvarCanceled As Boolean
  24. Private mvarTimer As Long
  25.  
  26. Friend Property Get Notify() As Object
  27.     Set Notify = mvarNotify
  28. End Property
  29. Friend Property Set Notify(Value As Object)
  30.     Set mvarNotify = Value
  31. End Property
  32. Friend Property Get TimerID() As Long
  33.     TimerID = mvarTimer
  34. End Property
  35. Friend Property Let TimerID(ByVal Value As Long)
  36.     mvarTimer = Value
  37. End Property
  38. Public Property Get Canceled() As Boolean
  39.     DoEvents ' DoEvents is called to allow other applications
  40.              ' to set the value of the canceled property.
  41.     Canceled = mvarCanceled
  42. End Property
  43. Public Property Let Canceled(ByVal Value As Boolean)
  44.     mvarCanceled = Value
  45. End Property
  46.  
  47. Public Sub StartApp(ToNotify As Object)
  48.     Canceled = False
  49.     Set Notify = ToNotify
  50.     StartTimer Me
  51. End Sub
  52.  
  53. Public Sub StopApp()
  54.     Canceled = True
  55. End Sub
  56.  
  57.  
  58.  
  59.  
  60.  
  61.