Board index » cppbuilder » TListBox not repainting correctly

TListBox not repainting correctly

I have a TListBox on a form and have set the Style to lbOwnerDrawFixed.  
When the TListBox is resized the items are not repainted correctly.  The
problem only occurs if the TListBox is resized horizontally (ie: width is
changed) and not when it is resized vertically.

The currently selected item in the TListBox is ALWAYS drawn correctly
regardless of how the list box is resized.  

The text contained in the item is always displayed correctly, however
everything else (border lines etc) is not.  When the form containing the
TListBox is made wider, if it is dragged slowly, the newly displayed
screen area that the item now occupies is not redrawn at all, although
placing a breakpoint inside the drawing routines shows that it is in fact
being called.  If it is dragged quicker, the border lines that are drawn
are 'disjointed'.

I have tried numerous ways to resolve the problem but have not found any
as yet.  If the TForm is maximized then all the items get redrawn
correctly so I am pretty sure the problem is not inside my draw routine.  
Any information on how to resolve this would be appreciated.  

Thanks in advance

Sean Hannan

 

Re:TListBox not repainting correctly


I have posted a screen capture that shows the problem in
borland.public.attachments.

Other Threads