Autor Beitrag
ts-d
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: Di 29.04.08 21:51 
Problem:

Ich möchte eine Bedingung formulieren: Wenn eine TImage-Komponente ein bestimmtes Bild geladen hat, soll ein anderes nicht geladen werden. Dazu muss ich aber das geladene Bild irgendwie herausbekommen. Wenn ich schreibe:

ausblenden Delphi-Quelltext
1:
    if (B_SucheStarten.Picture = './Data/buttons/Suche-starten2.jpg') ...					


kommt als Fehlermeldung TPicture ist nicht mit TString kompatibel.

Mit

ausblenden Delphi-Quelltext
1:
    if (B_SucheStarten.Picture.Graphic.GetNamePath = './Data/buttons/Suche-starten2.jpg')					


funtkioniert's auch nicht. Weiß jemand, wie man TPicture in TString umwandelt?

vg
ts-d

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
Moderiert von user profile iconNarses: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Di 29.04.2008 um 21:58
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 29.04.08 22:01 
Moin und :welcome: im Forum!

user profile iconts-d hat folgendes geschrieben:
Wenn eine TImage-Komponente ein bestimmtes Bild geladen hat, soll ein anderes nicht geladen werden. Dazu muss ich aber das geladene Bild irgendwie herausbekommen.
Ein TImage kann sich nicht merken, welches Bild hineingeladen wurde. Nimm einfach eine weitere Stringvariable, in der du den Dateinamen beim Laden abspeicherst. :idea:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
ts-d Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: Di 29.04.08 22:12 
Titel: danke
vg