You left out the PARENT property Regards
Bob Stanton On Fri, Oct 30, 2009 at 4:03 PM, totallyfreeenergy < totallyfreeene...@yahoo.com> wrote: > > > I was wondering how to create VCL components dynamically. For example > procedure TForm1.Image1DblClick(Sender: TObject); > var > Image_New : TImage; > abutton : TButton; > begin > // FSpell.Image_s1.Picture := FSpell.Image1.Picture; > Image_New := TImage.Create(Form1); > Image_New.Left := 8; > Image_New.Top := 222; > Image_New.Visible := true; > Image_New.Width := 60; > Image_New.Height := 60; > // Image_New.Create(Form1); > Image_New.Picture := Form1.Image1.Picture; > abutton := TButton.Create(Form1); > abutton.Left := 8; > abutton.Top := 250; > abutton.Caption := 'My New Button'; > abutton.Width := 120; > abutton.Height := 40; > end; > This code compiled ok. It had no problems creating Image_New. However the > Image_New and abutton are not there on the form. Obviously it is not created > although it gave no indication and did not crash while executing this code. > > Regards > TFE > http://totallyfreeenergy.zxq.net > > >