Set your TTreeView's DragMode property to dmAutomatic and then place this code in your Treeview's OnDragOver event:
procedure TForm1.TreeView1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
var
HitTests : THitTests;
begin
HitTests := TreeView1.GetHitTestInfoAt(X,Y);
if (htAbove in HitTests) then
TreeView1.TopItem := TreeView1.TopItem.GetPrevVisible
else if (htBelow in HitTests) then
TreeView1.TopItem := TreeView1.TopItem.GetNextVisible;
end;
Last Modified: 28-MAY-03