Autor Beitrag
Xadron
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

XP
C++, D7, HTML
BeitragVerfasst: Do 12.04.07 08:22 
Hallo,

Ich habe eine Listbox1. Wenn ich auf ein Item der Listbox klicke, soll der Itemname in einem Label escheinen.
Wie finde ich heraus, welches selektiert ist?

if listbox1.Items.count = 1 then ???
label2.Caption:=listbox1.Items[1];
if listbox1.Items.count = 2 then ???
label2.Caption:=listbox1.Items[2];
if listbox1.Ite.........

_________________
|x-32:88x+39-3|+3:21=47-4x
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Do 12.04.07 08:25 
ItemIndex und setz mal deinen Code in Delphi Tags.

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
Tastaro
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 414
Erhaltene Danke: 23



BeitragVerfasst: Do 12.04.07 08:26 
ausblenden Delphi-Quelltext
1:
   Label1.Caption := Listbox1.Items[Listbox1.ItemIndex];					


Beste Grüße
Tastaro
Xadron Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

XP
C++, D7, HTML
BeitragVerfasst: Do 12.04.07 08:31 
@ tastro:
Das mit dem Labelcaption ist ja von mir richtig.
Ich meinte diese, wo das Fragezeichen dahinter ist (if listbox1.Items.count = 1 then)
@Blackheart666 Danke ,geht

_________________
|x-32:88x+39-3|+3:21=47-4x