Autor Beitrag
Horst
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 120



BeitragVerfasst: Mi 15.10.03 17:57 
Hallo,

suche eine Lösung, wie ich Baumeinträge (treenodes) in einerm treeview verschieben kann, habe es mit folgendem Source versucht:

ausblenden Quelltext
1:
2:
3:
4:
  node1:=treeview1.items[treeview1.selected.absoluteindex-1];
  node2:=treeview1.items[treeview1.selected.absoluteindex];
  treeview1.items[treeview1.selected.absoluteindex]:=node1;
  treeview1.items[treeview1.selected.absoluteindex-1]:=node2;

funktioniert aber leider nicht. :bawling:
Hat einer ein Source-Beispiel, dass funktioniert. Danke.

Gruß

Horst
:wave:
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Mi 15.10.03 18:38 
Hallo,

die Eigenschaften, die du nanntest sind laut Legende Read-Only. Ich habe so was noch nie gedacht, aber schau mal TTreeNode.MoveTo() an.

_________________
Life is a bad adventure, but the graphic is really good!
Horst Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 120



BeitragVerfasst: Mi 15.10.03 20:00 
Titel: Baumeintrag verschieben (Gelöst!)
Hallo,

danke für den Tip, habe den Source jetzt wie folgt geändert:

ausblenden Quelltext
1:
2:
  node1:=treeview1.items[treeview1.selected.absoluteindex-1];
  treeview1.items[treeview1.selected.absoluteindex].moveto(node1,naInsert);

so funktioniert es! :mrgreen:

Gruß

Horst
:wave:
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Mi 15.10.03 20:23 
Bin doch froh wenn ich helfen kann!

_________________
Life is a bad adventure, but the graphic is really good!