- Create a new project
- Set the form height and width to something like 500.
- Drop a Scrollbox on the form and align to client.
- Drop a control into the scrollbox say a panel or a memo and make the control say 250 in width and height.
- Set the top value of the control you added to the scrollbox as say 50.
- Run the project and resize the form window from the right to left (make the window smaller) until the horizontal scrollbar appears, now slowly resize the window from left to right (make the window bigger) and notice the scrollbar still visible when it should not be.
- Stop the project and change the top value of the control you added to the scrollbox to 0 and repeat the above, the scrollbar range seems normal.
Attached project is working correctly with both Laz trunk and Laz 1.6.4 (Win 10). knuckles, you should upload a demo project.
@howardpc: I don't think that this is correct, I've used client-aligned scrollboxes many times. The one thing which must not be done is to client-align the scrollbox content, e.g. the panel within the scrollbox.
function TControlScrollBar.ClientSizeWithoutBar: integer;
var
ControlSize: Integer;
begin
if Kind = sbVertical then
ControlSize := FControl.Width
else
ControlSize := FControl.Height;
Result:=ClientSize;
if IsScrollBarVisible then
Result := Min(ControlSize, Result+GetSize+GetSystemMetrics(SM_SWSCROLLBARSPACING));
end;
Dam I spent too much time trying to install trunk from svn (not easy for beginners like me who never use svn etc).I think you are on Windows: