Einzelnen Beitrag anzeigen

Benutzerbild von mirage228
mirage228

Registriert seit: 23. Mär 2003
Ort: Münster
3.750 Beiträge
 
Delphi 2010 Professional
 
#4

Re: Text aus Listbox in Label

  Alt 7. Nov 2004, 18:56
Zitat von Spider:
Hi,

Delphi-Quellcode:
procedure {OnClick der Listbox}
begin
  Label1.Caption := ListBox1.Items.Strings[ListBox1.ItemIndex]
end;
*MFG*

Manu
Und wenn nichts gewählt und der Index daher = -1?

Also vorher abfragen:
Delphi-Quellcode:
  if ListBox1.ItemIndex > -1 then
    Label1.Caption := ListBox1.Items[ListBox1.ItemIndex]
mfG
mirage228
David F.

May the source be with you, stranger.
PHP Inspection Unit (Delphi-Unit zum Analysieren von PHP Code)
  Mit Zitat antworten Zitat