我在程序中自动生成了一组image和label控件,程序运行时可以显示控件但是提示 Invalide pointer operation,出错指在project文件的最后一行.下面是整个单元的源代码
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;type
  TForm1 = class(TForm)
    procedure FormDblClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormDblClick(Sender: TObject);
begin
  Close;
end;procedure TForm1.FormShow(Sender: TObject);
var
  stImage: Array of TImage;
  stLabel: Array of TLabel;
  i,j,Rows,Space1,ColWidth: integer;begin
  Rows:=6;
  Space1:=5;
  ColWidth:=150;
  SetLength(stImage,10);
  SetLength(stLabel,10);  for i:=1 to 10 do
  begin
    j:= (i div Rows)+1;    stImage[i]:=TImage.Create(self);
    stImage[i].Parent:=form1;
    stImage[i].Picture.LoadFromFile('d9.ico');
    stImage[i].Name:='image'+IntToStr(i);
    if i<Rows then stImage[i].Top:=2+35*((i mod Rows)-1)
    else stImage[i].Top:=2+35*(i mod Rows);
    stImage[i].Left:=2+ColWidth*(j-1);    stLabel[i]:=TLabel.Create(self);
    stLabel[i].Parent:=form1;
    stLabel[i].Caption:=IntToStr(i);
    stLabel[i].Width:=100;
    stLabel[i].Name:='label'+IntToStr(i);
    stLabel[i].Top:=stImage[i].Top+10;
    stLabel[i].Left:=stImage[i].Left+32+Space1;  end;
end;end.