Possible duplicate:
A Delphi control that can mimic add-ons, a list of Firefox extensions?
I would like to create a ListBox user control. It may look like Firefox downloads.

but instead of hard coding a custom drawing for any particular layout, I would like the layout to be defined separately. Let me explain, the list will have the published Layout property: TWinControl The idea is to design the layout in the ad panel, so in the example above it would look something like this:

Then in customdraw ListBox panel drawing will be used. Of course, each row will draw data for the corresponding element. Thus, the control will be DbAware, and the recordIndex will be adjusted for each draw. (I do not use DBAware controls, I use user data bindings, but this is the same principle)
Has anyone already done something similar? Think this is a good / bad idea?
I started writing a test application and edited this question to add specific implementation questions,
I hope to use only 1 instance of the panel for all lines, it should not be visible on it outside the list.
So far I have tried to use Panel.PaintTo() in the ListBox OnDrawItem , it basically works, but only if the Panel is parent and visible elsewhere on the form. Can I make the panel invisible, but still use it for drawing? How would you do that?
source share