...select a TreeView node with the right mouse button?

Author: Thomas Stutz

Category: VCL

procedure TForm1.TreeView1ContextPopup(Sender: TObject; MousePos: TPoint;
  var Handled: Boolean);
var
  
tmpNode: TTreeNode;
begin
  
tmpNode := (Sender as TTreeView).GetNodeAt(MousePos.X, MousePos.Y);
  if tmpNode <> nil then
    
TTreeView(Sender).Selected := tmpNode;
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base