plumothy
asked on
Automatic scrolling when dragging over TScrollBox (Delphi)
In my Delphi application I have a TScrollBox with only the vertical scroll bar enabled.
When the scroll box is too small for its contents then the vertical scroll box appears automatically - that's fine.
I would like the scrollbox to automatically scroll up and down as necessary when the user drags an object over it (so they can find the right place to drop it).
Does anyone know how to achieve this?
When the scroll box is too small for its contents then the vertical scroll box appears automatically - that's fine.
I would like the scrollbox to automatically scroll up and down as necessary when the user drags an object over it (so they can find the right place to drop it).
Does anyone know how to achieve this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect, thanks
procedure TForm1.ScrollBox1DragOver(
State: TDragState; var Accept: Boolean);
var calcX, calcY: Integer;
begin
//calcX, calcY calculate how you want it to scroll
ScrollBox1.ScrollBy(calcX,
end;
ziolko.