Results 1 to 3 of 3

Thread: Adding a method

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Adding a method

    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?

  2. #2
    Fanatic Member seec77's Avatar
    Join Date
    Jan 2003
    Posts
    596
    why don't you just do the following?
    VB Code:
    1. 'In a class module
    2.  
    3. Public Sub Test()
    4.    
    5.     MsgBox "Test"
    6.    
    7. End Sub
    say the name of the class is "CTest" you can do something like this:
    VB Code:
    1. Private Sub Form_Load()
    2.    
    3.     Dim Test As CTest 'Only dim space for the object
    4.    
    5.     Set Test = New CTest 'Create an instance of the object
    6.    
    7.     Test.Test 'Call the sub
    8.    
    9. 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)...
    Best Regards,
    seec77

    If you helped me, cosinder yourself thanked.

    Get each and every Garfield strip here!
    Here you can get all Calvin & Hobes strips!
    Damn UComics! It was probably unprofitable for them to allow us to just download Garfield and Calving & Hobes strips... so they made folder indexing unallowed on their server!!!

    I am 33% addicted to Counterstrike. What about you?
    I am 23% addicted to Star Wars. What about you?
    I am 0% addicted to Tupac. What about you?

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    I know but I was hoping to put the method allong with the other default methods. Oh well....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width