|
-
Mar 19th, 2004, 08:13 AM
#1
Thread Starter
Member
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
-
Mar 19th, 2004, 08:47 AM
#2
Fanatic Member
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.
-
Mar 19th, 2004, 09:19 AM
#3
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|