tina2009
asked on
lock all columns in a listview on a userform
possible to no permit the resize of all columns in a listview in a userform?
Tks
Tks
ASKER
but in a listview in a vba userform for excel?
Are your sure?
sorry me.
Are your sure?
sorry me.
Add this to your code.
ListView1.HideColumnHeader s = True
Then create labels that contain your "header" text and position them over the listview columns..
ListView1.HideColumnHeader
Then create labels that contain your "header" text and position them over the listview columns..
ASKER
Martin...
but i need HideColumnHeaders =false!
i need to use this event:
Private Sub ListView1_ColumnClick(ByVa l ColumnHeader As _
MSComctlLib.ColumnHeader)
but i need HideColumnHeaders =false!
i need to use this event:
Private Sub ListView1_ColumnClick(ByVa
MSComctlLib.ColumnHeader)
Use Label1_Click() instead.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
So that I can learn something, can you show me the code you found?
ASKER
Martin...
but only a prob....
when exit with unload me, peraphs a few function in bas module modLockLVCols of this project, freeze a form!
perphs i need to destrioed the function in unload me statement?
note:
you can use:
(0 is the first column in listview)
Subclass Me.ListView1.hWnd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
Lock-ListView-Columns.zip
but only a prob....
when exit with unload me, peraphs a few function in bas module modLockLVCols of this project, freeze a form!
perphs i need to destrioed the function in unload me statement?
note:
you can use:
(0 is the first column in listview)
Subclass Me.ListView1.hWnd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
Lock-ListView-Columns.zip
I've used subclassing in VB6 to do exactly what you want to do, and so the first thing I tried was to use the same code in VBA but it didn't work and I couldn't find solution that did work. It's not surprising that you are still having a problem since even in VB6 (which is more robust than VBA) you can have problems if you aren't careful.
I encourage you to keep looking for a solution by Googling things like safe VBA subclassing but I don't understand why my solution won't work for you.
I encourage you to keep looking for a solution by Googling things like safe VBA subclassing but I don't understand why my solution won't work for you.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
https://msdn.microsoft.com/en-us/library/system.windows.forms.listview.autoresizecolumns(v=vs.110).aspx
set it to ColumnHeaderAutoResizeStyl