我想做的是,点击一幅小的图片,后让她显示在另一个panel上。但当我者小幅图片是自动生成的image时,就去不到当前的i值.
procedure TForm1.BitBtn1Click(Sender: TObject);
var
i:integer;
begin
i:=1;
currentselectednum:=1;
while i<=maxshowbmpnum do
begin
if showbararray[i].showimage=(sender as Timage) then
begin
currentselectednum:=i;
i:=i+maxshowbmpnum;
end else
i:=i+1;
end;
bigview(currentselectednum);
end;
后再用image2.onclick:=bitbtn1.onclick,赋给image2.当为image2时,i=1 ,
但i值老取不到,是不是sender as timage 这句话不能用。
procedure TForm1.BitBtn1Click(Sender: TObject);
var
i:integer;
begin
i:=1;
currentselectednum:=1;
while i<=maxshowbmpnum do
begin
if showbararray[i].showimage=(sender as Timage) then
begin
currentselectednum:=i;
i:=i+maxshowbmpnum;
end else
i:=i+1;
end;
bigview(currentselectednum);
end;
后再用image2.onclick:=bitbtn1.onclick,赋给image2.当为image2时,i=1 ,
但i值老取不到,是不是sender as timage 这句话不能用。
问各位一个新的问题。
我在listview中动态生成的panel,怎样清空?
panel.caption:=""
if showbararray[i].showimage is Timage then
if Sender as TImage then
if TImage(Sender)=Showbararray[i].showimage then