如何将特定节点移动到第一个索引?

How do i move specific node to the first index?

我试图在按下按钮时将节点移动到 TVirtualStringTree 的顶部,所以我做的第一件事就是通过以下代码搜索节点

function Tform1.lookingTreeView(name: String): PVirtualNode;
var
  Node: PVirtualNode;
  Data: PUserData;
begin
  Result := nil;
  Node := Vts1.GetFirst;
  while ((Node <> nil) and (Result = nil)) do
  begin
    Data := Vts1.GetNodeData(Node);
    if (Tuserdataclass(Data.FObject).userUid = name) then
      Result := Node;
    Node := Vts1.GetNext(Node);
  end;
end;

然后我将程序设置为能够检查节点是否等于 "Martin"

procedure Tform1.checkmove;
var
  Node: PVirtualNode;
  Data: PUserData;
begin

  Node := lookingTreeView(LineToid);

  if not Assigned(Node) then
    Exit;
  if (Node <> nil) then
  begin
    Data := vts1.GetNodeData(Node);
    if Tdataclass(Data.FObject).name = 'Martin' then
    begin

      // start move but dont know what to do to bring this node to first index

    end;
  end;
end;

如评论中所述,使用 MoveTo:

Vts1.MoveTo(Node, Vts1.GetFirst, amInsertBefore, False);