Results 1 to 3 of 3

Thread: Need help on collection

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2003
    Posts
    47

    Need help on collection

    Hi all,

    I would like to know what the best container to use for a multiple type objects.
    For example, i have 3 structures, Line, Rectangle and Ellipse:

    Public Structure Line
    Public Point1, Point2 as Point
    Pubilc LineColor as Color
    Public Selected as Boolean
    End Structure

    Public Structure Rectangle
    Public Point1 as Point
    Public LineColor as Color
    Public Height, Width as Integer
    Public Selected as Boolean
    End Structure

    Public Structure Ellipse
    Public Point1 as Point
    Public LineColor as Color
    Pubilc Height, Width as Integer
    Public Selected as Boolean
    End Structure

    What would be the best container to use to store multiple type objects? Would an Arraylist be the best solution?

    Thanks

  2. #2
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    You could always create your own custom collection that inherits from collectionbase. That's what I do, then I can add all the nice methods that make it real easy to work with.

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2003
    Posts
    47
    Any coding examples? Thanks

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