Einzelnen Beitrag anzeigen

Benutzerbild von Lannes
Lannes

Registriert seit: 30. Jan 2005
Ort: Münster
745 Beiträge
 
Delphi 3 Professional
 
#2

Re: TListBox - Markierung bestimmter Elemente verbieten

  Alt 4. Apr 2005, 19:00
Hallo,

ob die Lösung elegant genug ist?
Delphi-Quellcode:
procedure TForm1.ListBox1Click(Sender: TObject);
begin
if ListBox1.ItemIndex in [1,2] then
  ListBox1.ItemIndex := ListBox1.Tag
  else
    ListBox1.Tag := ListBox1.ItemIndex;
end;
Item 1 und 2 kann so nicht selektiert werden,
eventuell ListBox1.Tag noch vorher richtig initialisieren(z.B. Form create?)
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
  Mit Zitat antworten Zitat