home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD93018252000.psc / colFrame.cls < prev    next >
Encoding:
Visual Basic class definition  |  2000-08-25  |  2.1 KB  |  73 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "colFrame"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = True
  14. Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
  15. Attribute VB_Ext_KEY = "Top_Level" ,"No"
  16. Attribute VB_Ext_KEY = "Collection" ,"claFrame"
  17. Attribute VB_Ext_KEY = "Member0" ,"claFrame"
  18. Option Explicit
  19.  
  20. Private mCol As Collection
  21.  
  22. ' PROPERTIES ************************************************
  23. Public Property Get Item(vntIndexKey As Variant) As claFrame
  24. Attribute Item.VB_UserMemId = 0
  25.     Set Item = mCol(vntIndexKey)
  26. End Property
  27.  
  28. Public Property Get Count() As Long
  29.     Count = mCol.Count
  30. End Property
  31.  
  32. Public Property Get NewEnum() As IUnknown
  33. Attribute NewEnum.VB_UserMemId = -4
  34. Attribute NewEnum.VB_MemberFlags = "40"
  35.     Set NewEnum = mCol.[_NewEnum]
  36. End Property
  37.  
  38. ' EVENTS ****************************************************
  39. Private Sub Class_Initialize()
  40.     'creates the collection when this class is created
  41.     Set mCol = New Collection
  42. End Sub
  43.  
  44. Private Sub Class_Terminate()
  45.     'destroys collection when this class is terminated
  46.     Set mCol = Nothing
  47. End Sub
  48.  
  49. ' METHODS ***************************************************
  50. Public Function Add(Key As String, ImageNum As Integer, Interval As Integer, Optional sKey As String) As claFrame
  51.     Dim objNewMember As claFrame
  52.     Set objNewMember = New claFrame
  53.  
  54.     'set the properties passed into the method
  55.     objNewMember.Key = Key
  56.     'objNewMember.Key = Key
  57.     objNewMember.Interval = Interval
  58.     objNewMember.ImageNum = ImageNum
  59.     If Len(sKey) = 0 Then
  60.         mCol.Add objNewMember
  61.     Else
  62.         mCol.Add objNewMember, sKey
  63.     End If
  64.  
  65.     'return the object created
  66.     Set Add = objNewMember
  67.     Set objNewMember = Nothing
  68. End Function
  69.  
  70. Public Sub Remove(vntIndexKey As Variant)
  71.     mCol.Remove vntIndexKey
  72. End Sub
  73.