Treeview - right-click node select


At the moment I need to left-click to select a node, then right-click for the pop-up menu. Is there a way to do a right-click select of a node?

Thanks, Bob


The right-mouse button is currently reserved for supporting popup menus. If you want to use the right mouse button to select an item you'll need to add the following code to your application:

procedure TForm1.TMSFNCTreeView1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Single);
  TMSFNCTreeView1.SelectVirtualNode(TMSFNCTreeView1.XYToNode(X, Y));

Lovely thanks - something like XYToNode is what I was looking for.

Cheers, Bob