A. Create a Delphi VCL Forms application.
B. Put a TTreeView on the form, name it tvTest
and fill it with items and set the size of the Treeview, so scrollbars are visible on the TreeView, for example:
C. Put a button on the form and in its click handler write this code:
procedure TForm1.btnScrollClick(Sender: TObject);
begin
tvTest.ScrollBy(tvTest.Width, 0);
end;
D. Now run the program and click the button. Supposedly the horizontal scrollbar should scroll from left to right. But nothing happens. Why?
So how can I make the scrollbars (and with the scrollbars of course the content) scroll from left to right, from right to left, down or up?
Delphi 10.1 Berlin Update 2
Windows 7 x64 SP1
EDIT: When I use this code (similar to Sami's suggestion):
tvTest.ScrollBy(-3, -3);
...I get this piece of modern art:
tvTest.ScrollBy(3, 3);
and click the button for 5 time you will see why – Habakkuk