jj wrote:
>
> Hello, clever types.
>
> I have a treeview filled with a multi-level structure and i want
> to drag and drop component nodes etc…
>
> How do i make the treeview scroll up/down/left/right when i drag a
> node to the edge of the treeview… Just like Windows explorer does
> when dragging files…
>
> Thankyoo
>
> Jon
I use the OnDragOver event and place code like this:
[code lang=”delphi”]procedure TSomeForm.TreeViewDragOver(Sender, Source: TObject;
X,Y: Integer; State: TDragState; var Accept: Boolean);
begin
If (y<15) Then //On the upper edge - should scroll up
SendMessage(TreeView.Handle,WM_VSCROLL,SB_LINEUP,0)
else If (TreeView.Height-y<15) Then // On the lower edge - should scroll down
SendMessage(TreeView.Handle,WM_VSCROLL,SB_LINEDOWN,0);
end;
Eyal.[/code]
[tags]Delphi, Components, TreeView[/tags]
0 Kommentare zu “Scroll Treeview when Drag/Drop”