Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'API Declaration in General Declarations
- Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32
- 'API Constants
- Const SET_COLUMN_WIDTH As Long = 4126
- Const AUTOSIZE_USEHEADER As Long = -2
- 'Sub To Resize
- Private Sub AppNewAutosizeColumns(ByVal TargetListView As ListView)
- Const SET_COLUMN_WIDTH As Long = 4126
- Const AUTOSIZE_USEHEADER As Long = -2
- Dim lngColumn As Long
- For lngColumn = 0 To (TargetListView.Columns.Count - 1)
- Call SendMessage(TargetListView.Handle, _
- SET_COLUMN_WIDTH, _
- lngColumn, _
- AUTOSIZE_USEHEADER)
- Next lngColumn
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement