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.
Printable View
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.
Just store the point in an array of points...
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.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
If this is VB 2005 and you want an easily resizable collection then use a List(Of Point). An ArrayList is so 2003 Gig. ;)