Results 1 to 2 of 2

Thread: Change the Highlight Color of the Listview Control

  1. #1

    Thread Starter
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    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.
    Attached Files Attached Files

  2. #2

    Thread Starter
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    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:
    1. Select Case Msg
    2.     Case WM_COMMAND
    3.         If lParam = m_LBHwnd Then
    4.             LongInt2Int wParam, iHw, iLW
    5.             Select Case (iHw)
    6.             Case LBN_SELCANCEL
    7.                 lCurind = SendMessage(lParam, LB_GETCURSEL, 0, ByVal 0&)
    8.             Case LBN_DBLCLK
    9.             End Select
    10.         End If
    11.     Case WM_DRAWITEM
    12.         If List_DrawItem(lParam) = 0 Then
    13.             '\\ We have handled the painting, so dont pass on to
    14.             '\\ default window procedure.
    15.             SubclassParent = 0
    16.             Exit Function
    17.         End If
    18.     Case Else
    19.         SubclassParent = 0
    20. End Select

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width