?? colregvalues.cls
字號:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "colRegValues"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'local variable to hold collection
Private mCol As Collection
Private mKey As Long
Public Sub Add(ByVal NewValue As ApiRegistryValue)
mCol.Add NewValue, IIf(NewValue.Name = "", "[Default]", NewValue.Name)
End Sub
Public Property Get Item(vntIndexKey As Variant) As ApiRegistryValue
'used when referencing an element in the collection
'vntIndexKey contains either the Index or Key to the collection,
'this is why it is declared as a Variant
'Syntax: Set foo = x.Item(xyz) or Set foo = x.Item(5)
Set Item = mCol(vntIndexKey)
End Property
Public Property Get Count() As Long
'used when retrieving the number of elements in the
'collection. Syntax: Debug.Print x.Count
Count = mCol.Count
End Property
'\\ --[NewValue]---------------------------------------------------------
'\\ Creates and adds a new registry value entry to this collection of subkeys.
'\\ -------------------------------------------------------------------
Public Function NewValue(ByVal Name As String, ByVal ValueType As enRegistryKeyValueTypes) As ApiRegistryValue
Dim tmpValue As ApiRegistryValue
Set NewValue = tmpValue
End Function
Friend Property Let ParentKey(ByVal NewKey As Long)
mKey = NewKey
End Property
Public Sub Remove(vntIndexKey As Variant)
'used when removing an element from the collection
'vntIndexKey contains either the Index or Key, which is why
'it is declared as a Variant
'Syntax: x.Remove(xyz)
mCol.Remove vntIndexKey
End Sub
Public Property Get NewEnum() As IUnknown
'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
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -