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!

Recommended Answers

All 2 Replies

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

thank u!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.