5,388
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.RzTreeView1NodeContextMenu(aSender: TObject; aNode: TTreeNode;
var aPos: TPoint; var aMenu: TPopupMenu);
var
TVNode : TTreeNode;
TV : TTreeView;
begin
TV := TTreeView(aSender);
TVNode := TV.GetNodeAt(aPos.X, aPos.Y) ;
if Assigned(TVNode) then
begin
TV.Selected := TVNode;
N1.Caption := Format('项目: %s',[TVNode.Text]) ;
aMenu := PopupMenu1;
end
else
begin
//不弹出菜单
aMenu := nil;
end;
end;