Creating Controls at Runtime in Delphi 6
Posted on 2003-10-30
I want to create an Image control on my form, (named frmMain).
In the Image control, I wish to place a picture (in this case, a picture of the Ace of Spades) that is loaded from my Resource file (which I can access without any problems).
Here's the code that I have...
bmp : TBitmap;
Card : TImage;
bmp := TBitmap.Create;
Card := TImage.Create(frmMain);
with Card do begin
Left := 120;
Top := 120;
Width := 71;
Height := 96;
Parent := frmMain;
Visible := True;
Card.Free; // Release the resource
Can anyone tell me why I can't see my Image control with the picture of the ace of spades in it? How do I "fix" it?