Put this in the area above the rest of the code in the form: (the General Declarations area)
Code:
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const LVS_SHOWSELALWAYS = &H8
This is the code that will make the change you want in the ListView. I suggest that you put it in Form_Load:
Code:
Dim lStyle As Long
lStyle = GetWindowLong(ListView1.hwnd, GWL_STYLE)
lStyle = lStyle Or LVS_SHOWSELALWAYS
SetWindowLong ListView1.hwnd, GWL_STYLE, lStyle
Of course, you should replace whatever says ListView1 with the name of your ListView.