|
-
Jun 5th, 2003, 05:45 PM
#1
Thread Starter
Need-a-life Member
ListView - ColumnHeader's width
Did you see when you double-click over the "border" of the columnheader that its width changes to fit all the info in it? Is there any way to programmatically do this?
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Jun 5th, 2003, 05:55 PM
#2
Hyperactive Member
Once again, wish I could take credit.....but I cant...
I found this, when I was attempting the same sort of thing....
works great!
Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lparam As Any) As Long
Public Const LVM_FIRST = &H1000
Public Const LVM_SETCOLUMNWIDTH = (LVM_FIRST + 30)
Public Const LVSCW_AUTOSIZE_USEHEADER As Long = -2
---------------------------------------------
With ListView1
colCnt = .ColumnHeaders.Count
ReDim myCols(colCnt)
intCol = 0
For i = 1 To colCnt
Call SendMessage(ListView1.hwnd, LVM_SETCOLUMNWIDTH, intCol, ByVal LVSCW_AUTOSIZE_USEHEADER)
intCol = intCol + 1
Next i
End With
--------------------------
Put the with right after I populated the listview.....and it takes care of everything at one time.....
Hope it helps!
-
Jun 5th, 2003, 06:12 PM
#3
Thread Starter
Need-a-life Member
Originally posted by VB4fun
...works great!....
It does, indeed!! Thank you very much!!
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Aug 3rd, 2007, 12:49 PM
#4
Addicted Member
Re: ListView - ColumnHeader's width
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|