1

I put al kinds of frames on a TScrollBox. When scrolling they are being scrolled correctly. Now I want to add an bitmap that remains on a fixed postion. I tried a TImage having the same parent (a TPanel) as the TScrollBox. I do not see the bitmap assigned to the TImage even when I use BringToFront.

Can anybody help me out?

Thanks in advance,

Arnold

Arnold
  • 4,578
  • 6
  • 52
  • 91
  • can you show the code where you assign a bitmap to TImage ? – heximal Aug 08 '11 at 13:00
  • You want to have a scroll box (that has content inside it) then you want to obscure (hide) the content of the scroll box by putting another thing (an image) in front of the content in the scroll box that does not move when you move the scrollbars? – Warren P Aug 08 '11 at 13:30

1 Answers1

6

TImage is a descendant of TGraphicControl. Since it lacks a window handle, it cannot appear in front of a windowed control like TScrollBox. Put the TImage on a TPanel, which has a handle, and place the TPanel in front of (with the same parent as) the TScrollBox.

Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
  • 1
    @deamon_x - Thanks for pointing this out to me! In the meantime I found code to make the panel transparent (http://www.martinstoeckli.ch/delphi/delphi.html) and by setting image.transparent to true the bitmap shows the background. Exactly what I wanted. Nice. Thank you all! – Arnold Aug 09 '11 at 18:00