Autor Beitrag
tartare
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89

Win XP SP2, WIN Vista Home Professional
Delphi 7/2009, C#, C++(VS 2005 Express)
BeitragVerfasst: Fr 14.04.06 12:20 
Hallo,
ich möchte ein Memory machen. Zu Beginn werden 30 images mit einer einheitlichen Rückseite erstellt.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
for i:= 1 to 30 do begin
  image[i]:=TImage.Create(self);
  with image[i] do begin
  parent:=panel[i];
  height:=60;
  width:=80;
  top:=0;
  left:=0;
  Picture.Bitmap.LoadFromFile('');
  end;
  end;


Wie kann ich jetzt ein onclick ereignis auf ein solches image programmieren?
Danke im vorraus
mfg Tartare

_________________
Ich leb in meiner eigenen Welt, aber das is ok, da kennt man mich.
King555
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 14.04.06 12:24 
Du deklarierst dir erst eine Prozedur im gleichen Aufbau wie das OnClick Ereignis (d.h. gleiche Parameter) und sagst dann:

image[i].OnClick:=DeinOnClickEreignis;
tartare Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89

Win XP SP2, WIN Vista Home Professional
Delphi 7/2009, C#, C++(VS 2005 Express)
BeitragVerfasst: Fr 14.04.06 12:44 
Hallo,
ich versteh es noch nicht ganz kannst du mal ein Beispielquelltext posten?
Danke im vorraus..
mfg Tartare

_________________
Ich leb in meiner eigenen Welt, aber das is ok, da kennt man mich.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 14.04.06 12:53 
user profile icontartare hat folgendes geschrieben:
Hallo,
ich versteh es noch nicht ganz kannst du mal ein Beispielquelltext posten?
Hat er doch:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.ImageClick(Sender: TObject);
begin
  //Was zu machen ist
end;

...

img1 := TImage.Create( self);
...
img1.onclick = ImageClick;
...

_________________
Markus Kinzler.