5,388
社区成员
发帖
与我相关
我的任务
分享
SetLength(image,4);
......
image[i] := TImage.Create(Self);
image[i].Caption := '打开';
image[i].Name := '名称'+inttostr(i);
image[i].Tag := i;
image[i].Top := top;
image[i].Left := Left;
image[i].OnClick := ClickImage;
......
在image的ClickImage点击事件中
if sender is TImage then
begin
i := (sender as TImage).tag;
showmessage(image[i].name);
end;
var
img: Timage;
begin
img := TImage.Create(Self);
img.Name := 'myImg';
.....