iterating through PictureBoxes in visual c++ <p>I'm programming in visual c++, and i have about 60 pictures (indexed p0...p63), and i want to make a loop that goes through all the pictures and change their <code>ImageLocation</code> under some conditions.</p> <p>I figured the <code>Tag</code> property and one of my attempts was like this: i tagged my pictures from 0 to 63 and then tried the following:</p> <pre><code>for(int i=0; i&lt;64; i++) { PictureBox-&gt;Tag[i]-&gt;ImageLocation="possible-.gif"; } </code></pre> <p>It's not working... I get this error:</p> <pre><code>syntax error : missing ';' before '-&gt;' line: 1514 syntax error : missing ';' before '-&gt;' line: 1514 </code></pre> <p>(twice, same line)</p> <p>What's the right way of doing it?</p> <p>Thank you!</p> <p><strong><em>edit:</em></strong></p> <p>OK now i have the pictures in an array. Is there a way to have a common rule for all of them? I want to make a click event for each and every one of the pictures. Is the only way setting a rule for each independently? Or can i set a rule for the array itself by saying something like:</p> <pre><code>if(Pictureboxes[i]_Clicked) { Pictureboxes[i].something = "something else"; } </code></pre>