Einzelnen Beitrag anzeigen

messie

Registriert seit: 2. Mär 2005
Ort: Göttingen
1.592 Beiträge
 
Delphi 2009 Professional
 
#2

Re: Bei wählen eines Listboxitem eine Aktion?

  Alt 17. Aug 2007, 15:30
Vielleicht so:
Delphi-Quellcode:
procedure TForm1.ListBox1Click(Sender: TObject);
begin
  ShowMessage(IntToStr(ListBox1.ItemIndex));
end;

procedure TForm1.ListBox1KeyPress(Sender: TObject; var Key: Char);
begin
  if (Key = #38) or (Key = #40) then //Pfeiltasten
  begin
    ShowMessage(IntToStr(ListBox1.ItemIndex));
  end;
end;
Grüße, Messie
  Mit Zitat antworten Zitat