Autor Beitrag
Ice
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 114



BeitragVerfasst: Mo 10.02.03 09:45 
Hallo Leute,

ich möchte gerne mit einer ImageKomponente Bitmaps anzeigen und diese zur Laufzeit wechseln können, Wenn ich in einer Listbox das ensprechende Bild auswähle.
Wie kann ich das machen?
Im voraus schonmal vielen Dank.

mfg
Ice
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mo 10.02.03 09:49 
Hallo,

was steht in der Listbox? Der Dateiname? Wenn ja, dann wie folgt:
ausblenden Quelltext
1:
2:
3:
4:
5:
procedure TForm1.ListBox1Click(Sender: TObject);
begin
  with TListBox(Sender) do if FileExists(Items[ItemIndex]) then 
    Image1.Picture.LoadFromFile(Items[ItemIndex]);
end;

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
Ice Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 114



BeitragVerfasst: Mo 10.02.03 10:05 
Ja vielen Dank.

mfg Ice