I have a Delphi form with a TScrollBox and some TImage components, and the form's scrollbox is not resetting when it's emptied... it appears to be growing every time a new image is thrown in the box.
I would like to reset the scroll range/size to the scrollbox size after I delete the image, before the next one is loaded. Is there a way to do that?
I've tried setting scrollbars invisible, and turning them back on after the next file loads and that doesn't seem to work. Any help greatly appreciated.
Root Cause: So it appears that the image moves its top-left corner to the center of where the image was located in the TScrollBox when the bitmap is freed.
TForm.AutoSize
set to true or false? TheTScrollBox.AutoSize
?TImage.AutoSize
? It sounds like you are not actually resizing the ScrollBox correctly, so its content area is not shrinking like you expect it to. – Remy Lebeau