CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2012
    Posts
    1

    CListCtrl: After scroll event received, the checkbox can not be clicked

    Hello everybody,

    i had a CListCtrl with Checkboxes in the first column. If i start my application i can click my checkbox or change his state. The Problem i had is, that if i scroll down to the end of the list, i can not click on any checkbox or change the state. If i click on the item name, i geht the NM_CLICK event, but on if i click on the checkbox, no event can be received.

    Does anybody had an idea, why my CListCtrl doesn't work?

    CListCtrl:
    Code:
    m_listCtrl.SetExtendedStyle(LVS_EX_CHECKBOXES|LVS_EX_GRIDLINES|LVS_EX_FLATSB|LVS_EX_FULLROWSELECT);
    MessageMap:
    [CODE]
    BEGIN_MESSAGE_MAP(cDialogSubPage, CDialog)
    ON_NOTIFY(NM_CLICK, LV_TS_CTE_TESTCASES, OnLVClick)
    ON_NOTIFY(LVN_ITEMCHANGED, LV_TS_CTE_TESTCASES, OnLVChanged)
    ON_NOTIFY(NM_CUSTOMDRAW, LV_TS_CTE_TESTCASES, OnCustomdrawList)
    END_MESSAGE_MAP()

    Have I forgotten something???

    Greetings, Bianca

  2. #2
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: CListCtrl: After scroll event received, the checkbox can not be clicked

    First of all, NM_CLICK is not an event, it is a notification code received as one of the parameters of the WM_NOTIFY message.
    In order to determine is going on, you would have to show code snippets from your WM_NOTIFY message handlers.
    I think, most likely is NM_CUSTOMDRAW notification handler (preventing redraw?).
    I am also not sure why you have to handle all three (NM_CLICK, LVN_ITEMCHANGED and NM_CUSTOMDRAW) notifications?
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

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

Featured