Jak przesunąć element o indeksie/nazwie 'x' na górę drzewa, klikając na przycisk [???]
Items.Exchange .. lub podobnie - wystarczyło F1. ehh
Exchange w TreeView? Jakoś nie widzę.
No to
<font color="brown">procedure MoveTo(Destination: TTreeNode; Mode: TNodeAttachMode);</span>
Heh, no o ty w zasadzie wiedziałem, gorzej z obsługą parametrów tej procedury.
x - index Itemu do ustawienia jako pierwszy.
TreeView1.Items[x].MoveTo(TreeView1.Items[x].Parent, naAddFirst);
Parametry masz opisane w Helpie:
<font color="brown">type TNodeAttachMode = (naAdd, naAddFirst, naAddChild, naAddChildFirst, naInsert);
Description
The TNodeAttachMode type specifies the way a new or relocated tree node will be related to some other node.
Value Meaning
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.</span>