如题.比方说我要把该treeview
A
  -a
  -b
  -c
  -d
对c结点进行上移,或者下移,变成
A
 -a
 -c
 -b
 -d
求具体代码,谢谢

解决方案 »

  1.   

    MoveTo method (TTreeNode)Moves the node to another location in the tree view.Delphi syntax:procedure MoveTo(Destination: TTreeNode; Mode: TNodeAttachMode);C++ syntax:virtual void __fastcall MoveTo(TTreeNode* Destination, TNodeAttachMode Mode);DescriptionThe Destination parameter specifies a node that will be this node's parent or sibling after the move. The Mode parameter specifies the new relationship between this node and the destination node.
    enum TNodeAttachMode {naAdd, naAddFirst, naAddChild, naAddChildFirst, naInsert};naAdd The new or relocated node becomes the last sibling of the other node.
    naAddFirst The new or relocated node becomes the first sibling of the other node.
    naInsert The new or relocated node becomes the sibling immediately before the other node.
    naAddChild The new or relocated node becomes the last child of the other node.
    naAddChildFirst The new or relocated node becomes the first child of the other node.
      

  2.   

    我用的是delphi,不知道能不能说详细点,初学者,不过还是谢谢你.
      

  3.   

    就是
    nodeC.moveto(nodeB,naInsert);