954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

find index of array object

Hello :)
for a chess program, i made a 8x8 array of square:PictureBox objects
and i set variables inside them for the row & col
there is a way to dont use those row & col variables and just "take" the index of the
square from the 8x8 array when i need the location of it?
for example when i click on it and i have the square as (sender as Square) there is a way to know where its loacation inside the array?

thanks in advance!

galhajaj
Light Poster
36 posts since May 2011
Reputation Points: 13
Solved Threads: 0
 

You could set the tab order or you could fill in a Tag field.
Perhaps you could assign a number to each Square?
You could extract a number from the Name?
Many possibilities. Remember the formula is i*8+j.
Have a look at the last post in this thread: http://www.daniweb.com/software-development/csharp/threads/363377

ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
 

thank u!

galhajaj
Light Poster
36 posts since May 2011
Reputation Points: 13
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: