Autor Beitrag
wham1010
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17

Win XP Prof.
D6 Pers
BeitragVerfasst: Di 12.07.05 02:49 
Hallo!

Ich bin da auf ein kleines Problem gestoßen und weder hier noch im google auf eine Lösung gestoßen!
Und zwar habe ich auf einer Form 10 Bilder und möchte nun, wenn ich mit der Maus über eines der Bilder drüberfahr, auswerten können, über welchem der Bilder sich nun der Mauszeiger befindet. Mit X und Y allein ist es nicht getan, denn ich rufe bei allen 10 bildern dieselbe Prozedur auf - und wenn ich da angebe "mach dies und jenes, wenn X größer als 10 ist", dann bezieht sich das auf jedes bild und nicht nur auf jenes, wo sich der Mauszeiger drüber befindet!

Ich hoffe, ich konnte mein Problem halbwegs verständlich machen ;-)

Vielen Dank im Voraus!
iKilledKenny
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 8

Win XP
D5 Prof, C# Express 2005
BeitragVerfasst: Di 12.07.05 08:20 
hi,

nicht sehr elegant, aber müsste wohl so funktionieren:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
if Sender = Bild1 then
  // tu was mit bild 1
else
if Sender = Bild2 then
  // tu was mit bild 2
else ...
end;


viele grüße
alex
Tilman
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1405
Erhaltene Danke: 51

Win 7, Android
Turbo Delphi, Eclipse
BeitragVerfasst: Di 12.07.05 08:23 
ich würde jedem Bild ein Tag zuweisen (Bild1.tag = 1, Bild2.tag = 2....).

Dann kannst du mit (Sender as TImage).tag abfragen welches Bild gemeint ist.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 12.07.05 08:26 
Alternativ die Tag-Eigenschaft der Bilder mitbenutzen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
Case (Sender as TIMage).Tag of
1: // Bild1
2: // Bild2
end;


Edit: Zu langsam... :?

_________________
We are, we were and will not be.
wham1010 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17

Win XP Prof.
D6 Pers
BeitragVerfasst: Di 12.07.05 08:32 
Vielen Dank - so funktionierts!