[Lazarus] How to make TCheckListBox read only

Batman albertonarduzzi at yahoo.com
Thu Aug 4 10:57:06 CEST 2011



> procedure TForm1.CheckListBox1ItemClick(Sender: TObject; Index: integer);
> begin
>   checklistbox1.Checked[index] := not  checklistbox1.Checked[index] ;
> end;

that _of_course_ wouldn't work. It's not the user changing the checkboxes... 
it's your code!


if you disable the checklistbox, that will only keep the users from being able 
to change the status of the single checkboxes.
Moreover, why are you toggling the "checked" propery, in the onclick? It gets 
changes its state already...

Cheers, A.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110804/1a5752ae/attachment-0003.html>


More information about the Lazarus mailing list