Solved

CustomDrawItem/SubItems

Posted on 2001-09-14
3
665 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 300 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

773 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