[Lazarus] How to make TCheckListBox read only

Zaher Dirkey parmaja at gmail.com
Thu Aug 4 22:55:09 CEST 2011


On Thu, Aug 4, 2011 at 11:16 PM, Alberto Narduzzi <albertonarduzzi at yahoo.com
> wrote:

> I saw that my reply posted from the web was not readable... :-(
>
> So here it is again.
>
>
>
>  A simple
>>
>> checklistbox1.enabled := false wouldnt do it.
>>
>> Try this code :
>>
>> procedure TForm1.CheckListBox1ItemClick(**Sender: TObject; Index:
>> integer);
>> begin
>> checklistbox1.Checked[index] := not checklistbox1.Checked[index] ;
>> end;
>>
>
>
For me that not a good solution, imagen we have no readonly in memo, can we
have same solution like this?.
I prefer to add ReadOnly to that components.

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.
>
> --
> ______________________________**_________________
> Lazarus mailing list
> Lazarus at lists.lazarus.**freepascal.org<Lazarus at lists.lazarus.freepascal.org>
> http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarus<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>
>



-- 
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110804/13ab6367/attachment-0003.html>


More information about the Lazarus mailing list