如何使用索引操作创建类?
我将Item属性添加到类中。这使wrapped_dict.Item(12) = 13
起作用。但是wrapped_dict(12) = 13
仍然无效。
这是用于包装字典以使其将大写和小写键视为相同的键。
这是我尝试过的:
Option Explicit
Private dict As New Dictionary
Property Get Item(ByRef Key As Variant) As Variant
Item = dict(Key)
End Property
Property Set Item(ByRef Key As Variant, ByRef Item As Variant)
dict(Key) = Item
End Property
Property Let Item(ByRef Key As Variant, ByRef Item As Variant)
dict(Key) = Item
End Property