My program uses a 32x32 grid of image boxes in it's interface. The images are dynamically created (using a control array) at startup. I need a way to take the control index and convert it into the X and Y coordinates of the control (reletive to the grid).

For a better example of what i'm looking for, take a look at this picture: I want to convert an number in yellow into the corrisponding "green" numbers.

(picture won't load here)
http://agent_153.tripod.com/grid.html

I this example, if I passed 7 to the sub, the return values would be x=2 and y=3