Autor Beitrag
DarkHunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 477

Win XP
D3 Prof, D2005 PE
BeitragVerfasst: Do 01.04.04 17:23 
hallo ist es möglich das ein objektname aus einer variable geladen wird?
zb so
ausblenden Delphi-Quelltext
1:
(variable).picture.loadfromfile ('bild.bmp');					
bms
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: Do 01.04.04 17:42 
Jajn. Eher indirekt, aber es geht. Hier ein Beispiel mit einem Button:

ausblenden Quelltext
1:
TButton(FindComponent('Button1')).Caption := 'Hallo';					


geht auch so:

ausblenden Quelltext
1:
(FindComponent('Button1') as TButton).Caption := 'Hallo';					


Bei deinem Beispiel wäre das in etwa so:

ausblenden Quelltext
1:
(FindComponent('Image1') as TImage).picture.loadfromfile ('bild.bmp');					


Aber vorsicht: wenn nichts gefunden wird, dann gibt es eine Fehlermeldung.
DarkHunter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 477

Win XP
D3 Prof, D2005 PE
BeitragVerfasst: Do 01.04.04 20:08 
vielleicht sollte ich erläutern warum ich das will

ich habe 4 images die im endeffekt alle das selbe tun
deswegen will ich mir dafür eine procedure schreiben auf die alle 4 zugreifen und nur der name des objekt (image 1 -4 ) geändert wird
Brainiac
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 01.04.04 22:41 
Benutz doch die Sender-Variable.
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Do 01.04.04 23:00 
Brainiac hat folgendes geschrieben:
Benutz doch die Sender-Variable.
Die gibt's aber nur in Events der Images...
Wenn man schon einen Button hat der alle vier Bilder ändern soll, geht's über den Sender des OnClick-Events des Buttons nicht mehr ;-)

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Brainiac
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 01.04.04 23:26 
stimmt auch wieder... vergesst was ich gesagt habe.
bms
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: Do 01.04.04 23:33 
Du kannst auch ein Array benutzen. Image[1].Picture.LoadFromFile().
DarkHunter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 477

Win XP
D3 Prof, D2005 PE
BeitragVerfasst: Fr 02.04.04 13:31 
ok das mit dem array könnte ich probieren
bms
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: Fr 02.04.04 14:09 
Aber was hast du gegen FindComponent? Ist für dein Problem wie gemacht.
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Fr 02.04.04 20:41 
DarkHunter hat folgendes geschrieben:
ok das mit dem array könnte ich probieren
Dazu müsstest du aber die Images auch wieder dynamisch erzeugen. Wenn du nach dem Name-Property suchst, ist FindComponent schon die richtigste Lösung ;-)

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
NetZwerg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 448

Slackware 10.1
Kylix 3, D5 Standard
BeitragVerfasst: So 04.04.04 16:24 
gibt es sowas auch für variablen?

_________________
"Manche Leute drücken nur deshalb ein Auge zu, damit sie besser zielen können."
Billy Wilder, amer. Filmregisseur
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 04.04.04 16:33 
NetZwerg hat folgendes geschrieben:
gibt es sowas auch für variablen?

Nein..!

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
NetZwerg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 448

Slackware 10.1
Kylix 3, D5 Standard
BeitragVerfasst: So 04.04.04 16:37 
nein?? kann man das irgendwie anders machen?? :(

_________________
"Manche Leute drücken nur deshalb ein Auge zu, damit sie besser zielen können."
Billy Wilder, amer. Filmregisseur
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 04.04.04 16:40 
Variablennamen werden nicht gespeichert..! Aber wozu brauchst du das denn..?

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 04.04.04 22:38 
Ich hab den Rest in einen eigenen Thread abgeteilt da es ja im Prinzip wieder ein neues Problem ist. Der abgeteilte Thread befindet sich hier.

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!