|
-
Feb 15th, 2009, 05:04 AM
#1
Thread Starter
PowerPoster
[RESOLVED] [2005] ListView Column Headers Question
I would like to know if it is possible if the columns of the listview can be resized automatically based on the information in the listview?
-
Feb 15th, 2009, 05:46 AM
#2
Re: [2005] ListView Column Headers Question
If am not sure if there is an automatic way of doing this, but when you are finished populating the ListView, you could loop through each of the columns, then using TextRenderer.MeasureText find out the length of the longest string and then set the Width of the Column.
Hope that helps!!
Gary
-
Feb 15th, 2009, 07:11 AM
#3
Re: [2005] ListView Column Headers Question
Once again, reading the MSDN documentation is all it would take to answer this question. Looking at the member listing for the ListView class, the AutoResizeColumns method is the fifth member in the list.
-
Feb 15th, 2009, 07:13 AM
#4
Re: [2005] ListView Column Headers Question
oops, I did have a quick skim through the documentation, but I must have missed that one.
Sorry about that!!
Gary
-
Feb 15th, 2009, 12:12 PM
#5
Thread Starter
PowerPoster
Re: [2005] ListView Column Headers Question
i went to the MSDN and i missed it too. thanks all.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|