Autor Beitrag
The_Tremendous
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47

Win XP SP2
Borland Delphi 6
BeitragVerfasst: Sa 04.06.05 16:09 
Hallo, habe folgendes Problem:

Ich lade verschiedene strings aus einer Textdatei in eine Listbox. In der Listbox kann ich ja dann mit der maus einen der Werte markieren.

Wie kann ich den markierten Wert in eine Variable speichern??


The-Tremendous


Moderiert von user profile iconTino: Topic aus Sonstiges verschoben am So 05.06.2005 um 00:19
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Sa 04.06.05 16:31 
meinst du sowas?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
var s: string;
begin
 if ListBox1.ItemIndex > -1 then
   begin
      s:= ListBox1.Items[ListBox1.ItemIndex];
      //...
   end;
end;

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
The_Tremendous Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47

Win XP SP2
Borland Delphi 6
BeitragVerfasst: Sa 04.06.05 16:33 
Danke für die Antwort.

ListBox1.Items[ListBox1.ItemIndex];

Genau das habe ich gesucht.