Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TreeNodes suppressed selection



Permlink Replies: 1 - Last Post: Oct 5, 2015 10:32 AM Last Post By: Remy Lebeau (Te...
Vaclav Smidl

Posts: 27
Registered: 1/23/11
TreeNodes suppressed selection
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 4, 2015 11:36 PM
Hello,
I would like to suppressed selection ability for TTreeNode in TTreeView with no reaction on clicking on this node. Something like TreeNode->selectable =false.
Is there any function for this?
thank you
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: TreeNodes suppressed selection [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 5, 2015 10:32 AM   in response to: Vaclav Smidl in response to: Vaclav Smidl
Vaclav wrote:

I would like to suppressed selection ability for TTreeNode in
TTreeView with no reaction on clicking on this node. Something
like TreeNode->selectable =false.

Use the TTreeView.OnChanging event. It has an AllowChange parameter that
you can set to True/False as needed.

However, do note that the event only tells you which node is being selected,
but not which node is losing the current selection, or whether the selection
is changing due to mouse or keyboard input. Microsoft provides that information,
but TTreeView ignores it. If you need it, you will have to subclass the
TTreeView and handle the TVN_SELCHANGING notification directly.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02