TTreeView scrolling lazarus / 31-LCL ---------------------------------------------------------------------- jcmontherock · 2018-01-08 15:29 Is there a way to scroll a Treeview to show the selected item ? "myTreeView.Selected.MakeVisible" and "myTreeView.Selected.Focused := true" have no effect and seems not to work. An automatic scrolling is done at half of the height and I cannot change this amount. ---------------------------------------------------------------------- balazsszekely · 2018-01-08 16:05 Hi jcmontherock, Try: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  myTreeView.TopItem := myTreeView.Selected; ---------------------------------------------------------------------- jcmontherock · 2018-01-08 16:47 Thanks GetMem. Unfortunately, it does not work better. ---------------------------------------------------------------------- balazsszekely · 2018-01-08 16:51 Please specify Lazarus/FPC version and  OS. Can you attach a demo example that demonstrates the issue? TTreeView.TopItem works as expected here. ---------------------------------------------------------------------- JD · 2018-01-08 20:23 Quote from: jcmontherock on January 08, 2018, 04:29:21 pmIs there a way to scroll a Treeview to show the selected item ? "myTreeView.Selected.MakeVisible" and "myTreeView.Selected.Focused := true" have no effect and seems not to work. An automatic scrolling is done at half of the height and I cannot change this amount. Don't know if this can help you but when I have a TreeView with a lot of items, I usually search/scroll through it using the TTreeFilterEdit control. Since it implements incremental search, it reduces the number of items in the TreeView until it gets to an exact match. Then what is visible/highlighted in the TreeView is ultimately what will be selected by the user. JD ---------------------------------------------------------------------- jcmontherock · 2018-01-09 21:28 Lazarus 1.8.0, fpc 3.04, Windows 10 (64 bits), Laptop 13.3". I prepare a sample. ---------------------------------------------------------------------- jcmontherock · 2018-01-10 13:58 I wrote a sample. I works !...  So I will investigate to see why it does not work with my app. Maybe it's coming from a package. Thanks to everybody. ---------------------------------------------------------------------- jcmontherock · 2018-01-10 20:16 Finally I begin to understand: my laptop screen has an "applied DPI" of 144. In the project option at "Application params" the best result for window form and to have a Treeview scrolling ok, I have to set the LCL scaling and no use of manifest and "take in account DPI" desactivated. It's not the best view but it makes the TreeView working fine. Thanks to everybody for suggestions.