?
Solved

CustomDrawItem/SubItems

Posted on 2001-09-14
3
Medium Priority
?
676 Views
Last Modified: 2007-11-27
Folks,

I need to draw the SubItems of a listview manually. My Problem is, how to determine the leftposition of a subitem (i'm currently doing this with the columns-property of the listview).
Now, when the user resizes one of the columns, the width-property of the Column in Columns property is not updated and the Subitem (TextOut()) is drawn on a wrong position.

I'm using OnCustomDrawSubItem. Everything works except the drawing while the user resizes a column.

Please help!
Thanks, Bruno
0
Comment
Question by:brunohe
  • 2
3 Comments
 

Author Comment

by:brunohe
ID: 6481983
Get another 500 points for a helping answer.
0
 
LVL 4

Accepted Solution

by:
fva earned 1200 total points
ID: 6482068
Looks like a bug in VCL. Try to avoid using the Columns when you need the width and use instead the LVM_GETCOLUMNWIDTH message like this:

theColumnWidth:=SendMessage(YourListView.Handle,LVM_GETCOLUMNWIDTH,theColumnIndex,0);

F.
0
 

Author Comment

by:brunohe
ID: 6482526

That's it, thanks for help! Great job!

cu, Grz, Brunohe
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question