Lazarus

Programming => LCL => Topic started by: Marion on May 05, 2021, 10:24:58 pm

Title: HOWTO: Prevent editing of TTreeNode
Post by: Marion on May 05, 2021, 10:24:58 pm
I am using the TTreeView but I don't want users to be able to edit the node text. How do I prevent that?
Title: Re: HOWTO: Prevent editing of TTreeNode
Post by: wp on May 05, 2021, 10:51:49 pm
There is also a more direct ReadOnly property; it definitely works, I used it many times.

In case that you only want to inhibit editing of specific nodes you can hook into the OnEditing event which offers a var parameter "AllowEdit" which you simply must set to false in the event handler for the corresponding node.
Title: Re: HOWTO: Prevent editing of TTreeNode
Post by: Marion on May 06, 2021, 12:33:27 am
Thank you all.
TinyPortal © 2005-2018