Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleMake the columns fit the data in a ListView control in VB .NET
KeywordsListView, column width, VB.NET
CategoriesVB.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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated