Thema: Delphi Auswahl aus der Listbox

Einzelnen Beitrag anzeigen

Benutzerbild von Mirilin
Mirilin

Registriert seit: 21. Dez 2002
Ort: Lenzburg
861 Beiträge
 
Delphi 6 Professional
 
#4

Re: Auswahl aus der Listbox

  Alt 2. Apr 2004, 20:35


Also bei mir hats geklappt.

Delphi-Quellcode:
procedure TMainForm.ListBoxKeyPress(Sender: TObject; var Key: Char);
begin
  if Uppercase(Key) = 'Uthen
  begin
    if ListBox.ItemIndex = 0 then
      ListBox.ItemIndex := ListBox.Items.Count-1
    else
      ListBox.ItemIndex := ListBox.ItemIndex - 1;
  end;
  if Uppercase(Key) = 'Dthen
  begin
    if ListBox.ItemIndex = ListBox.Items.Count - 1 then
      ListBox.ItemIndex := 0
    else
      ListBox.ItemIndex := ListBox.ItemIndex + 1;
  end;
end;
mfg Tobias
Tobias
Die Physik ist für die Physiker eigentlich viel zu schwer.
  Mit Zitat antworten Zitat