1 Attachment(s)
Change the Highlight Color of the Listview Control
Hello,
I found this module code on this forum that lets me change the highlight color of a listbox by subclassing which works correctly. I would like to do the same with a Listview control, I tried building a test project but the class doesn't work on a listview (I replaced all references of Listbox with Listview). Does anybody know what could be wrong? Thank you.
Re: Change the Highlight Color of the Listview Control
I think the problem is here, the color should be changed when the WM_DRAWITEM message is sent, however even when I click the Listview the message doesn't get sent.
VB Code:
Select Case Msg
Case WM_COMMAND
If lParam = m_LBHwnd Then
LongInt2Int wParam, iHw, iLW
Select Case (iHw)
Case LBN_SELCANCEL
lCurind = SendMessage(lParam, LB_GETCURSEL, 0, ByVal 0&)
Case LBN_DBLCLK
End Select
End If
Case WM_DRAWITEM
If List_DrawItem(lParam) = 0 Then
'\\ We have handled the painting, so dont pass on to
'\\ default window procedure.
SubclassParent = 0
Exit Function
End If
Case Else
SubclassParent = 0
End Select