Forum > LCL

ListView with background image



How to put a image as a background in a TListView component?

It will be great if one can write some like
TListView1.Background :='C:\MyFavouriteImage.BMP'

I think that with this property,it will be more easy to create a
desktop-like application.

For example, WineXO do not have desktop icons, and one can
mimic a real Windows desktop using this feature.


I'm sorry to dig up an old thread but I'd like to know how to do exactly the same thing. Found some Delphi stuff but it involves the Windows API that can't be used on Linux, as obvious.
Tried to set the OwnerDraw property to True and wrote an event handler:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TFrmResults.lvResultsCustomDraw(Sender: TCustomListView;  const ARect: TRect; var DefaultDraw: Boolean);begin  Canvas.CopyRect(ARect, FrmMinigolfeeCheck.imgTerrain.Canvas, ARect);  DefaultDraw:=True;end; But the list items are drawn badly; it seems that setting DefaultDraw to True doesn't work and I don't seem to see the background image. Or am I missing something?


[0] Message Index

Go to full version