Autor Beitrag
andre.maus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

winXP
Delphi 7
BeitragVerfasst: Fr 02.07.04 10:19 
Hallo,

ich habe eine ListBox die wie folgt aussieht:

[00:00]
[01:00]
[02:00]
[03:00]
...


wie kann ich es hinkriegen, dass wenn jemand beispielsweise den ersten Eintrag [00:00] anwählt und anschliessend per Buttonclick einen String erhält, wo dann '00' drin steht. Selbiges auch für die anderen Einträge ('01', '02', '03',...)

Mit anderen Wort
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
{ Pseudocode }

procedure myButton_clicked()
   if [00:00] was selected
      myString := '00'


Vielen Dank für jeden Tip!

Gruß,
Andre

Moderiert von user profile iconTino: Delphi-Tags hinzugefügt.
MartinPb
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 698



BeitragVerfasst: Fr 02.07.04 10:25 
Ich verstehe die Frage nicht ganz. Vor allem den Teil mit

Zitat:
Selbiges auch für die anderen Einträge ('01', '02', '03',...)

_________________
Gruß
Martin
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 02.07.04 11:15 
vielleicht etwas wie
ausblenden Delphi-Quelltext
1:
2:
i := listbox1.itemindex;
meinstring := listbox1.Items.Strings[i][1] + listbox1.Items.Strings[i][2];
?

_________________
We are, we were and will not be.
andre.maus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

winXP
Delphi 7
BeitragVerfasst: So 04.07.04 06:06 
stimmt,

ich habe es echt blöd formuliert. Also mal anders:

wenn ich Element a anwähle will ich einen String 'hello' erhalten.
wenn ich Element b anwähle will ich einen String 'world' erhalten.

Also quasi nicht das selbe, was in der listbox steht.

Hoffe jetzt wurde ich verstanden :wink:
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 04.07.04 07:38 
Das geht einfach so:
ausblenden Delphi-Quelltext
1:
meinstring:=listbox1.items.strings[listbox1.itemindex];					

_________________
We are, we were and will not be.