Search code examples
c++winapimfcclistctrl

MFC limit selected item in ClistCtrl


Hi I use ClistCtrl that have 20 items and I want to limit selected item number. for example only 10 item can be selected. how i can do it? thanks for your help herzl.


Solution

  • You would have to handle the LVN_ODSTATECHANGED notification message and count the number of selected item each time the LVIS_SELECTED state changes

    Thanks