?
Solved

CustomDrawItem/SubItems

Posted on 2001-09-14
3
Medium Priority
?
672 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn 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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month11 days, 21 hours left to enroll

752 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