Hi,
I'm playing around with creating images dynamically in Delphi 4. This code works when placed in the FormCreate procedure but not when placed in its own procedure. Why not?
The form is called frm1.
Creating the global variable/array BT:
Many thanks and merry Christmas,
Froskoy.
I'm playing around with creating images dynamically in Delphi 4. This code works when placed in the FormCreate procedure but not when placed in its own procedure. Why not?
The form is called frm1.
Code:
for i:=1 to 10 do
begin
imgBT[i]:=TimgBT.Create(frm1);
with imgBT[i] do
begin
Parent:=frm1;
Width:=20;
Height:=30;
Picture.LoadFromFile(Path+IntToStr(i)+'.bmp');
Transparent:=TRUE;
Top:=100;
Left:=40+20*i;
Visible:=TRUE;
end;
end;
Creating the global variable/array BT:
Code:
type TimgBT = class(TImage);
var imgBT : array[1..10] of TimgBT;
Many thanks and merry Christmas,
Froskoy.