动态生成的Panel,如何编写他的OnClick事件???
Panel是动态生成的。请问怎么编写和响应它的OnClick事件。
Panel是这样生成的:
procedure TFormSmallOneSet.FormCreate(Sender: TObject);
var
x,y:Integer;
begin
for x:=1 to 20 do
begin
for y:= 1 to 20 do
begin
PicCell[x,y]:=TPanel.Create(FormSmallOneSet);
// PicCell[x,y].Show;
PicCell[x,y].Parent := Self;
PicCell[x,y].Width := 32;
PicCell[x,y].Height := 24;
PicCell[x,y].Left := (x-1)*32+1;
PicCell[x,y].Top := 35+(y-1)*24+1;
PicCell[x,y].Color := $0080FFFF;
end;
end;
end;
有400个动态生成的Panel,怎么响应每个的OnClick事件。