How to get the widths of the columns in a ListView 
Author Message
 How to get the widths of the columns in a ListView

With the follwoing command I set the widths of the 3 columns of my
ListView 'Sample_ListView':

  With Sample_ListView
     .View = lvwReport
     Set ColumnHeader_Item = .ColumnHeaders.Add(, , "Text1", Width1,
lvwColumnLeft)
     Set ColumnHeader_Item = .ColumnHeaders.Add(, , "Text2", Width2,
lvwColumnLeft)
     Set ColumnHeader_Item = .ColumnHeaders.Add(, , "Text3", Width3,
lvwColumnLeft)
  End With

Now the user can resize the widths of the columns with the mouse.
But how can I get the actual widths of each column?

Any help and information is very appreciated
Stefan



Mon, 26 Apr 2004 15:19:43 GMT  
 How to get the widths of the columns in a ListView
With Sample_ListView.ColumnHeaders
    Width1 = .Item(1).Width
    Width2 = .Item(2).Width
    Width3 = .Item(3).Width
End With

Hope this helps,
Johan.



Quote:
> With the follwoing command I set the widths of the 3 columns of my
> ListView 'Sample_ListView':

>   With Sample_ListView
>      .View = lvwReport
>      Set ColumnHeader_Item = .ColumnHeaders.Add(, , "Text1", Width1,
> lvwColumnLeft)
>      Set ColumnHeader_Item = .ColumnHeaders.Add(, , "Text2", Width2,
> lvwColumnLeft)
>      Set ColumnHeader_Item = .ColumnHeaders.Add(, , "Text3", Width3,
> lvwColumnLeft)
>   End With

> Now the user can resize the widths of the columns with the mouse.
> But how can I get the actual widths of each column?

> Any help and information is very appreciated
> Stefan



Tue, 27 Apr 2004 04:38:10 GMT  
 How to get the widths of the columns in a ListView
Stefan,
  Sample_ListView.ColumnHeaders.Item(index).Width
HTH,Neila
Quote:

> With the follwoing command I set the widths of the 3 columns of my
> ListView 'Sample_ListView':

>   With Sample_ListView
>      .View = lvwReport
>      Set ColumnHeader_Item = .ColumnHeaders.Add(, , "Text1", Width1,
> lvwColumnLeft)
>      Set ColumnHeader_Item = .ColumnHeaders.Add(, , "Text2", Width2,
> lvwColumnLeft)
>      Set ColumnHeader_Item = .ColumnHeaders.Add(, , "Text3", Width3,
> lvwColumnLeft)
>   End With

> Now the user can resize the widths of the columns with the mouse.
> But how can I get the actual widths of each column?

> Any help and information is very appreciated
> Stefan



Tue, 27 Apr 2004 07:28:55 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ListView column width = ListView width ?

2. Getting column widths of listview

3. Total width of columns = Width of ListView

4. Total width of columns = Width of ListView

5. Total width of columns = Width of ListView

6. Total width of columns = Width of ListView

7. Preserving column widths in Listview

8. How to get control if you resize the width of a Column in a ListView

9. Listview: Auto set column width?

10. Column widths not "sticky" in ListView

11. ListView returning incorrect column width

12. How to lock column width in ListView?

 

 
Powered by phpBB® Forum Software