Tree control: Avoid changing selection on RightClick?

Started by roy_043, April 16, 2017, 02:09:24 PM

Previous topic - Next topic

roy_043

I am working with a tree control and want to collapse all but the current branch of the tree when the user right clicks anywhere on the control. The problem is that right clicking first fires the SelChanged event. Is there a way to avoid this?

The goal:
Left click: Change selection.
Right click: Do not change selection.

roy_043

So... what I want is probably is not possible.

While playing with this, I noticed something that strikes me as strange:
When I use the LMB to select an item I have to click on the actual image or label.
If I do the same with the RMB the whole row (image, label, white space on the right and left) can be clicked.