This is a section of code:
this->SquareImage1->Visible = false;
this->SquareImage2->Visible = false;
this->SquareImage3->Visible = false;
this->SquareImage4->Visible = false;
this->SquareImage5->Visible = false;
this->SquareImage6->Visible = false;
this->SquareImage7->Visible = false;
this->SquareImage8->Visible = false;
this->SquareImage9->Visible = false;
this->SquareImage10->Visible = false;
this->SquareImage11->Visible = false;
this->SquareImage12->Visible = false;
this->SquareImage13->Visible = false;
this->SquareImage14->Visible = false;
this->SquareImage15->Visible = false;
this->SquareImage16->Visible = false;
this->SquareImage17->Visible = false;
this->SquareImage18->Visible = false;
this->SquareImage19->Visible = false;
this->SquareImage20->Visible = false;
this->SquareImage21->Visible = false;
this->SquareImage22->Visible = false;
this->SquareImage23->Visible = false;
this->SquareImage24->Visible = false;
this->SquareImage25->Visible = false;
this->SquareImage26->Visible = false;
this->SquareImage27->Visible = false;
this->SquareImage28->Visible = false;
this->SquareImage29->Visible = false;
this->SquareImage30->Visible = false;
this->SquareImage31->Visible = false;
this->SquareImage32->Visible = false;
this->SquareImage33->Visible = false;
this->SquareImage34->Visible = false;
this->SquareImage35->Visible = false;
this->SquareImage36->Visible = false;
this->SquareImage37->Visible = false;
this->SquareImage38->Visible = false;
this->SquareImage39->Visible = false;
this->SquareImage40->Visible = false;
this->SquareImage41->Visible = false;
this->SquareImage42->Visible = false;
this->SquareImage43->Visible = false;
this->SquareImage44->Visible = false;
this->SquareImage45->Visible = false;
this->SquareImage46->Visible = false;
this->SquareImage47->Visible = false;
this->SquareImage48->Visible = false;
this->SquareImage49->Visible = false;
this->SquareImage50->Visible = false;
this->SquareImage51->Visible = false;
this->SquareImage52->Visible = false;
this->SquareImage53->Visible = false;
this->SquareImage54->Visible = false;
this->SquareImage55->Visible = false;
this->SquareImage56->Visible = false;
this->SquareImage57->Visible = false;
this->SquareImage58->Visible = false;
this->SquareImage59->Visible = false;
this->SquareImage60->Visible = false;
this->SquareImage61->Visible = false;
this->SquareImage62->Visible = false;
this->SquareImage63->Visible = false;
this->SquareImage64->Visible = false;
As you can see, it's a lot of lines.
How can I do this so that it just cycles through a loop and sets all of them to false?
E.G like:
for(int i=1;i<65;i++)
{
this->some sort of array here->Visible = false;
}
Thanks for any help anyone gives!