Is there any way to add a method to a collection aside from Add, Count, Item and Remove?
I've playing around with classes for hours now and I can't figure out a way to do so. Is is possible?
Printable View
Is there any way to add a method to a collection aside from Add, Count, Item and Remove?
I've playing around with classes for hours now and I can't figure out a way to do so. Is is possible?
why don't you just do the following?
say the name of the class is "CTest" you can do something like this:VB Code:
'In a class module Public Sub Test() MsgBox "Test" End Sub
you know that a collection is just a class module with a collection object (which is also a class module with an array)...VB Code:
Private Sub Form_Load() Dim Test As CTest 'Only dim space for the object Set Test = New CTest 'Create an instance of the object Test.Test 'Call the sub End Sub
I know but I was hoping to put the method allong with the other default methods. Oh well....