Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Virtual TreeView Nodes vertauschen (MoveUp/MoveDown) (https://www.delphipraxis.net/132134-virtual-treeview-nodes-vertauschen-moveup-movedown.html)

toms 8. Apr 2009 23:12

Re: Virtual TreeView Nodes vertauschen (MoveUp/MoveDown)
 
das ganze in einer Procedure verpackt:

Delphi-Quellcode:
type
  TMoveDirection = (mdDown, mdUp);

procedure TForm1.VST_MoveNode(VST: TBaseVirtualTree; Direction: TMoveDirection);
var
  Node: PVirtualNode;
begin
  Node := VST.FocusedNode;
  if Assigned(Node) then
  begin
    case Direction of
      mdUp: VST.MoveTo(Node, VST.GetPrevious(Node), amInsertBefore, False);
      mdDown: VST.MoveTo(Node, VST.GetNext(Node), amInsertAfter, False);
    end;
    VST.Selected[Node] := True;
  end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:17 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz