Difference between CListCtrl and CListBox Item changed message
Posted on 2008-10-13
I am really having trouble understanding why the List changed functions of listbox and listctrl behave differently.
In my application i have 2 controls, a listbox and a list control.
for OnLbnSelChange function of the list box, even if i click anywhere on the listbox, the GetCurSel() function always return the index of selected item, i.e. it keeps the item selected even if click on anywhere else on the list box.
For listctrl, if an item is selected and i click anywhere else on the list ctrl, the position of GetFirstSelectedItemPosition() is always returned null and the item is not highlighted anymore.
how can i have the same behaviour same as listbox with list control??