Tscrollbox and Timage lazarus / 31-LCL ---------------------------------------------------------------------- christensen · 2011-10-09 11:37 Hi, I have some problems with scrollbars from scrollbox. i cannot center the Timage on it. On the Tpanel the Timage is working well, but if i add the Tscrollbox then doesn't.both components are align to 'client'. (Form -> Tpanel -> Tscrolbox -> Timage) The position of the Horizontal scrollbar is on the left side and the Vertical scrollbar is at the top(doesn't matter the Anchors setup). Both scrollbars are set to be at the position '0', if i change the position in developing mode is working but when i run it will be in the same place like at the beginning. ---------------------------------------------------------------------- User137 · 2011-10-09 15:12 The whole point of TScrollBox is that you don't have automatic sizing, therefore your image must have align = alNone. You can do something like: Code: [Select]procedure TForm1.Image1Resize()... var x,y: integer; begin   x:=(ScrollBox1.Width-Image1.Width) div 2;   y:=(ScrollBox1.Height-Image1.Height) div 2;   if x<0 then x:=0;   if y<0 then y:=0;   image1.Left:=x;   image1.Top:=y; end;