procedure TfrmMain.TV1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var Node:TTreeNode; begin Node:=TV1.GetNodeAt(X,Y); if Node<>nil then Node.Selected:=True; TV1.PopupMenu :=nil; if button=mbright then begin case Node.Level of 1,3,5: begin TV1.PopupMenu :=popMeu; //加一句使TPopupMenu弹出的语句,我忘了怎么写了 end; end; end; end;
Shift: TShiftState; X, Y: Integer);
var
Node:TTreeNode;
begin
Node:=TV1.GetNodeAt(X,Y);
if Node<>nil then Node.Selected:=True;
TV1.PopupMenu :=nil;
if button=mbright then
begin
case Node.Level of
1,3,5:
begin
TV1.PopupMenu :=popMeu;
//加一句使TPopupMenu弹出的语句,我忘了怎么写了
end;
end;
end;
end;