Einzelnen Beitrag anzeigen

Benutzerbild von Bummi
Bummi

Registriert seit: 15. Jun 2010
Ort: Augsburg Bayern Süddeutschland
3.470 Beiträge
 
Delphi XE3 Enterprise
 
#4

AW: CheckListBox, immer nur einen Eintrag auswählen

  Alt 29. Okt 2012, 14:49
vielleicht willst Du es so lösen ...
Delphi-Quellcode:
Procedure DisEnableAllExcept(clb:TChecklistBox;ignore:Integer);
var
 i:Integer;
begin

  for I := 0 to clb.Items.Count -1 do
      begin
      if ignore=-1 then clb.ItemEnabled[i] := true
      else
      if i <> ignore then clb.ItemEnabled[i] := false;
      end;

end;

procedure TForm3.CheckListBox1ClickCheck(Sender: TObject);
begin
   if CheckListBox1.Checked[CheckListBox1.ItemIndex] then DisEnableAllExcept(TChecklistBox(Sender),CheckListBox1.ItemIndex)
   else DisEnableAllExcept(TChecklistBox(Sender),-1);

end;
Thomas Wassermann H₂♂
Das Problem steckt meistens zwischen den Ohren
DRY DRY KISS
H₂ (wenn bei meinen Snipplets nichts anderes angegeben ist Lizenz: WTFPL)
  Mit Zitat antworten Zitat