|
|
Title | Make the columns fit the data in a ListView control in VB .NET |
Keywords | ListView, column width, VB.NET |
Categories | VB.NET, Controls |
|
|
If you set a column's width to -1, the ListView control resizes the column to fit its data. If you set its width to -2, the control sizes the control to fit the column's data and header.
|
|
' Size the columns.
For i As Integer = 0 To lvwBooks.Columns.Count - 1
lvwBooks.Columns(i).Width = -2
Next i
|
|
|
|
|
|