Autor Beitrag
th3Thr1ll3r
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 31

Win XP Prof
Delphi 6 Pers.
BeitragVerfasst: So 30.10.05 13:58 
HeiHo!!

Wie kann ich bei einer ListBox den Namen von einem Item, das ausgewählt wurde, d.h. ich habe die Items Salbei, Majoran, Rosmarin und Oregano!
Und ich möchte, das, wenn zum Beispiel Salbei ausgewählt wurde, das ich die String 'Salbei' schnell brekomme, also mit Form1.ListBox1.????

greetZ

th3Thr1ll3r


Moderiert von user profile iconAXMD: Topic aus Sonstiges verschoben am Mi 02.11.2005 um 14:54
Grishnak
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 221

Windows XP Home
Delphi 7 PE, Delphi 2005 PE
BeitragVerfasst: So 30.10.05 14:28 
Sorry, ich würde dir gerne helfen, aber ich verstehe deine Frage (grammatikalisch) nicht!

_________________
Mach' etwas idiotensicher und irgendjemand erfindet einen besseren Idioten!
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: So 30.10.05 15:50 
Das bekommst du mit
ausblenden Delphi-Quelltext
1:
ListBox1.Items.Strings[ListBox1.ItemIndex]					

raus. Dabei ist ItemIndex der Index des markierten Eintrages.

_________________
Radioactive
"Wer scrollt, verliert!" Matthias Stein, Informatiklehrer am GG
Horst_H
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1654
Erhaltene Danke: 244

WIN10,PuppyLinux
FreePascal,Lazarus
BeitragVerfasst: So 30.10.05 16:05 
Hallo,

in der Delphi-Hilfe zu TlistBox steht es auch mit Beispiel, falls man zum Beispiel MultiSelect = true gewaehlt hat.

ListBox1.Selected[i] = True oder false.

Gruss Horst
th3Thr1ll3r Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 31

Win XP Prof
Delphi 6 Pers.
BeitragVerfasst: So 30.10.05 20:59 
user profile iconRadioactive hat folgendes geschrieben:
Das bekommst du mit
ausblenden Delphi-Quelltext
1:
ListBox1.Items.Strings[ListBox1.ItemIndex]					

raus. Dabei ist ItemIndex der Index des markierten Eintrages.


Danke, genau das wollte ich :D

thx'n'greetZ

th3Thr1ll3r
smepal
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68

Win XP, Linux Mandbrake,SUSE 10.1, SUSE 9 PE, DEBIAN, Win 2000 Pro, Win XP Pro
Delphi
BeitragVerfasst: So 30.10.05 21:16 
bei mir kommat dann folgende fehlermeldung
Listenindex überschreitet das Maximum (-1)

Help me was mache ich falsch
taipan84
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 17



BeitragVerfasst: So 30.10.05 21:39 
@smepal:

Wahrscheinlich hast du einfach keinen Eintrag ausgewählt. Am besten prüft man vorher, ob überhaupt ein Eintrag gewählt ist.

Frag einfach ab, ob ItemIndex >= 0 ist.

Und übrigens: Warum hast du nicht erst gesucht und dieses Thema gelesen, bevor du nen eigenen Thread mit derselben Fragestellung aufmachst? Die Suchfunktion gibt es auch für dich...