Anders Melander 1794 Posted April 12 Is it a known problem that the VCL misinterprets the valid range of TScrollBar's PageSize and Max properties? TScrollBar enforces the rule that PageSize must be <= Max but Windows requires that PageSize be <= Max-Min+1... This means that if one sets PageSize=Max it is still possible to move the scrollbar +/-1 unit. One work around seems to be to set Min to 1 - because TScrollBar forgets to take Min into account when validating PageSize 🤦♂️ https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setscrollinfo Quote The nPage member must specify a value from 0 to nMax - nMin +1. Share this post Link to post
MarkShark 27 Posted April 12 I did a lot of trial and error while working on the scrollbars for SynEdit and setting min to 1 seemed necessary. The code I ended up with is in SynEditScrollBars. The official documentation did seem a bit off in some cases. -Mark Share this post Link to post
Anders Melander 1794 Posted April 14 I think the MS documentation, while a bit terse, is clear enough; It specifies how the different properties and their limits relate to each other. The Delphi documentation though is severely lacking. If they had tried to document it properly they would probably have discovered that they got it wrong. Share this post Link to post