Autor Beitrag
accessViolation
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 68

Win
Delphi 5 Enterpr.
BeitragVerfasst: Do 01.06.06 15:07 
Hallo!

Ich erzeuge zur Laufzeit dynamisch mehrere Timer. In der Tag-Eigenschaft werden die Timer fortlaufend numeriert. Allen Timern weise ich die gleiche Ereignisprozedur (z.B. timerX.OnTimer := tmZeitAbgelaufen). Die Timer werden dann einer TObjectList (timerStore.Add(timerX)) hinzugefügt.

Jetzt möchte ich in der Ereignisprozedur [TForm1.tmZeitAbgelaufen(Sender: TObject)] die Timer anhand der Tag-Eigenschaft identifizieren. Wie mache ich das? Kann ich über Sender:TOjbect darauf zugreifen? Oder muss ich es irgendwie anders machen?

Hoffe Ihr könnt mir helfen.

Gruß
Dietmar
Horschdware
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 744
Erhaltene Danke: 54

Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
BeitragVerfasst: Do 01.06.06 15:10 
ausblenden Delphi-Quelltext
1:
(Sender as TTimer).Tag					

_________________
Delphi: XE - OS: Windows 7 Professional x64
The Who
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 25

Win XP Prof
D3 Prof, D8, D7E
BeitragVerfasst: Do 01.06.06 15:45 
Nur mal so als Frage:

Kann man nicht einfach per self.Tag prüfen welcher Timer es ist ?
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Do 01.06.06 15:58 
self wäre das Form, also nein

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
accessViolation Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 68

Win
Delphi 5 Enterpr.
BeitragVerfasst: Do 01.06.06 16:43 
Vielen Dank!

Da fällt mir gleich ein: Was ist eigentlich der Unterschied zwischen
(Sender as TTimer).Tag und TTimer(Sender).Tag?