Results 1 to 4 of 4

Thread: Using a Collection in a class

  1. #1

    Thread Starter
    Lively Member dbarr's Avatar
    Join Date
    Oct 2001
    Location
    Syracuse, NY
    Posts
    86

    Question Using a Collection in a class

    I want to be able to have a collection in an ActiveX EXE and have the parent add items to it. I cannot see the collection in the parent. Any suggestions?

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Is the collection a property of the main class or object you are working with?

  3. #3

    Thread Starter
    Lively Member dbarr's Avatar
    Join Date
    Oct 2001
    Location
    Syracuse, NY
    Posts
    86
    I tried making the collection Public in the main Class but needed to put it in a module in order to compile.




    Is the collection a property of the main class or object you are working with?

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Well this is how I would do it:
    I would make the class that I want to have a collection of as a class module in my ActiveX Exe. Then I would use the Class Builder Utility that is in VB to make a collection of the class also in the ActiveX Exe. Then I would Make a property of the collection in my class that I want to work with. That will create a type of Heirarchy kind of. If you wanted to let the user make individual classes and then add them to the collection you could make it multiuse or if not you could use something like private or public not creatable. Here I'll included a small sample.

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