Autor Beitrag
coolace
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 141



BeitragVerfasst: So 13.11.11 16:47 
Hy,

ich will folgendes machen, ich habe 18 picture Boxen die mit diversen Bildern
geladen werden.

Laden
ausblenden C#-Quelltext
1:
p4.Image = Image.FromFile(quelle);					


nun will ich aber folgendes rausfinden, wenn jemand z.B. picture Box 2 anklickt
will ich ausgeben wie der Dateiname ist.

ausblenden C#-Quelltext
1:
p1.Image.toString();					


hat hier nicht den gewünschten Erfolg gebracht und die Forensuche auch nicht.
Geht das überhaupt, und wenn ja wie ?

Gruß

Coolace
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4764
Erhaltene Danke: 1052

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: So 13.11.11 17:39 
Hallo,

nein, das geht so nicht, da die PictureBox nur das Image selbst kennt (nicht die Quelle, d.h. den Pfadnamen).
Diesen mußt du dir dann in einem Container (List<string> o.ä.) selber merken.
coolace Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 141



BeitragVerfasst: Mo 14.11.11 17:41 
Danke