|
-
Jun 1st, 2006, 10:36 PM
#1
Thread Starter
New Member
X,Y coordinates in array
i am looking for a way to store x,y coordinates in a array. I need to be able to recall the x and y seperatly later in the program.
-
Jun 1st, 2006, 11:32 PM
#2
Re: X,Y coordinates in array
Just store the point in an array of points...
VB Code:
Dim MyPoints(1) As Point
MyPoints(0) = New Point(5, 10)
MyPoints(1) = New Point(15, 20)
MessageBox.Show(MyPoints(0).X.ToString) 'x value of 1st item
MessageBox.Show(MyPoints(1).X.ToString) 'x value of 2nd item
Or you can use an arraylist and add the point to it so you can just add the items on the fly. Then just cast the object in the arraylist to a point in order to access its properties.
-
Jun 1st, 2006, 11:35 PM
#3
Re: X,Y coordinates in array
If this is VB 2005 and you want an easily resizable collection then use a List(Of Point). An ArrayList is so 2003 Gig.
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
|