Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-08

How to make TCheckListBox read only

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Batman
to Unknown author: An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/laz…
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.freepascal.org/pipermail/lazarus/attachments/20110804/1a5752ae/attachment.html>

Reply by email

Zaher Dirkey
to Felipe Monteiro de Carvalho: 2011/8/4 I just tested in Gtk2 and setting enabled to false made the checklistbox…

2011/8/4 Felipe Monteiro de Carvalho

Show quoted text 14 lines
2011/8/4 A simple > > checklistbox1.enabled := false wouldnt do it. > I just tested in Gtk2 and setting enabled to false made the checklistbox read-only. Why do you think that it doesn't work?
Enable := False In Windows make the list in light gray colors and scrollbars
not work (also disabled)
> Felipe Monteiro de Carvalho > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > > -- Zaher Dirkey -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110804/3de6a8f4/attachment.html>

Reply by email

Alberto Narduzzi
to Unknown author: An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/laz…

I saw that my reply posted from the web was not readable... :-(

So here it is again.

Show quoted text 10 lines
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;

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.

Reply by email

Zaher Dirkey
to Alberto Narduzzi

On Thu, Aug 4, 2011 at 11:16 PM, Alberto Narduzzi <

Show quoted text 22 lines
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...

Show quoted text 15 lines
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 .**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.freepascal.org/pipermail/lazarus/attachments/20110804/13ab6367/attachment.html>

Reply by email