home *** CD-ROM | disk | FTP | other *** search
Visual Basic class definition | 2001-09-09 | 2.3 KB | 87 lines |
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- Persistable = 0 'NotPersistable
- DataBindingBehavior = 0 'vbNone
- DataSourceBehavior = 0 'vbNone
- MTSTransactionMode = 0 'NotAnMTSObject
- END
- Attribute VB_Name = "CVerMenus"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = False
- Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
- Attribute VB_Ext_KEY = "Top_Level" ,"No"
- Attribute VB_Ext_KEY = "Collection" ,"CVerMenu"
- Attribute VB_Ext_KEY = "Member0" ,"CVerMenu"
- '-----------------------------------------------------------------------------
- ' This is a part of the BeeGrid ActiveX control.
- ' Copyright ⌐ 2000 Stinga
- ' All rights reserved.
- '
- ' You have a right to use and distribute the BeeGrid sample files in original
- ' form or modified, provided that you agree that Stinga has no warranty,
- ' obligations, or liability for any sample application files.
- '-----------------------------------------------------------------------------
- Option Explicit
-
- Private mCol As Collection
-
- Public Function Add(Caption As String, Optional sKey As String) As CVerMenu
- 'create a new object
- Dim objNewMember As CVerMenu
- Set objNewMember = New CVerMenu
-
- objNewMember.Caption = Caption
- objNewMember.Index = mCol.Count + 1
-
- If Len(sKey) = 0 Then
- mCol.Add objNewMember
- Else
- mCol.Add objNewMember, sKey
- End If
-
- 'return the object created
- Set Add = objNewMember
- Set objNewMember = Nothing
- End Function
-
- Public Property Get Item(vntIndexKey As Variant) As CVerMenu
- Attribute Item.VB_UserMemId = 0
- Set Item = mCol(vntIndexKey)
- End Property
-
-
-
- Public Property Get Count() As Long
- Count = mCol.Count
- End Property
-
-
- Public Sub Remove(vntIndexKey As Variant)
- mCol.Remove vntIndexKey
- End Sub
-
-
- Public Property Get NewEnum() As IUnknown
- Attribute NewEnum.VB_UserMemId = -4
- Attribute NewEnum.VB_MemberFlags = "40"
- 'this property allows you to enumerate
- 'this collection with the For...Each syntax
- Set NewEnum = mCol.[_NewEnum]
- End Property
-
-
- Private Sub Class_Initialize()
- 'creates the collection when this class is created
- Set mCol = New Collection
- End Sub
-
-
- Private Sub Class_Terminate()
- 'destroys collection when this class is terminated
- Set mCol = Nothing
- End Sub
-
-