
ListView.Width <> Sum of ColumnHeader widths
Hi David,
<<<<<<<
I am trying to set the width of the column headers of my
ListView so that, together, they span the entire width
of the ListView. Instead they always come out
significantly wider, giving me a horizontal scroll bar
that I don't want. My code follows:
lvwAccts.ColumnHeaders(1).Width = _
lvwAccts.Width / 4
lvwAccts.ColumnHeaders(2).Width = _
lvwAccts.Width / 4
lvwAccts.ColumnHeaders(3).Width = _
lvwAccts.Width / 2
But the sum of the column header widths always adds up
to more than the width of the ListView whence they were
derived. Does anyone know what I'm doing wrong?
The width of a column in a ListView control cannot be set by using a
property and/or method when the View property is set to List. But
the following Knowledge Base article gives a generic procedure that can be
used to set the width of a column in a ListView control when in List view.
"How to Set the Column Width of Columns in a ListView Control"
To access this article refer to the following site.
http://www.microsoft.com/kb/articles/q147/6/66.htm
If your default view is report then you need not go for the above said
method.
Hope this helps,
Have a nice time,
Bharathy Mohan M.
Aditi Corp.
Aditi Corp was formerly known as NetQuest Inc.
P.S. : Worried about response times to your queries?
Check out our FREE technical support service at http://www.aditi.com/nntp.htm
OR just click on the attached link
begin 600 link.url
M6TEN=&5R;F5T4VAO<G1C=71=#0I54DP]:'1T<#HO+W=W=RYA9&ET:2YC;VTO
*;FYT<"YH=&T-"FAO
`
End