VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



How to AutoSize ListView columns (in report mode) to fit data in.

by Francesc Montoya (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 23rd April 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

How to AutoSize ListView columns (in report mode) to fit data in.

API Declarations



Private Const LVM_FIRST As Long = &H1000
Private Const LVM_SETCOLUMNWIDTH As Long = LVM_FIRST + 30

Private Const LVSCW_AUTOSIZE_USEHEADER As Long = -2


Rate How to AutoSize ListView columns (in report mode) to fit data in.



Dim i As Integer

 For i = 0 To iListView.ColumnHeaders.Count - 1
  Call SendMessage(iListView.hwnd, LVM_SETCOLUMNWIDTH, i, LVSCW_AUTOSIZE_USEHEADER)
 Next
 iListView.Refresh

End Sub

Download this snippet    Add to My Saved Code

How to AutoSize ListView columns (in report mode) to fit data in. Comments

No comments have been posted about How to AutoSize ListView columns (in report mode) to fit data in.. Why not be the first to post a comment about How to AutoSize ListView columns (in report mode) to fit data in..

Post your comment

Subject:
Message:
0/1000 characters