I'm using Delphi and I created an array of ten elements of type TImage
whit this name and structure:
Form3.images[1..max] of TImage.
I tried to initialize it in this way:
for x := 1 to max do
begin
images[x] := TImage.Create(Form3);
images[x].AutoSize := True;
images[x].Name := 'image' + IntToStr(x);
images[x].Visible := true;
images[x].Parent := Form3;
end;
After that I tried to put the content of another variable (called Form3.a1:TImage) to every element of the array.
I tried to do this with these instructions:
for i := 1 to max do
begin
Form3.Images[i]:=Form3.a1; // ( Form3.a1: TImage) <- this is visible
end;
(I don't know if using the instructions before, is the right thing to do) After that I changed positions of array's images:
//Form3.square:TShape
x := Form3.square.Left;
y := Form3.square.Top;
Form3.Images[1].Top := y + 70;
Form3.Images[1].Left := x + 60;
...
Form3.Images[1].Top := y + 10;
Form3.Images[1].Left := x + 50;
I set different positions for each image of the array but when I run the program, images of the array aren't visible. I also tried to set Form3.square.visible=false but nothing changes.
This is what I want:
- have the same contents between variable
a1
and variables of the arrayimages
, changing only positions - make array's images visible (I tried
images[x].Visible := true;
but it doesn't work).
please i need help, I can give other details. Thank you.