Solved

CustomDrawItem/SubItems

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now