搞定了,分分拿来
TreeView1需要设置MultiSelect = True;
MultiSelStyle设置为[msControlSelect]
procedure Tform1.TreeView1Click(Sender: TObject);
var
TNode,Cnode: TTreeNode;
i: Integer;
iLoop: Boolean;
begin
Cnode:= self.TreeView1.Selected;
if not Cnode.Expanded then Exit;
if Cnode.HasChildren then
begin
TNode:= Cnode.getFirstChild;
TNode.Selected:= True;
iLoop:= True;
while iLoop do
begin
TNode:= TNode.GetNext;
TreeView1.Select(TNode,[ssCtrl]);
if TNode = Cnode.GetLastChild then Break;
end;
end;