Delphi-Quellcode:
procedure TForm1.imgBackroundMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
i, j : integer ;
begin
for i := 1 to 34 do begin
j := (findcomponent('Image'+inttostr(i)) as TImage).Left;
if X >= j
// if (X >= Image(i).Left) and (X <= Image(i).Left+Image(i).Width ) and
// (Y >= Image(i).Top ) and (Y <= Image(i).Top +Image(i).Height)
then label1.Caption := 'JIIIHA' else label1.Caption := 'RAMSIIIM' ;
end;
end;
So müsste es gehen...
Du darfst Left nicht in FindComponent reintun