Click to See Complete Forum and Search --> : Problem with drag and drop in multiple selected CListBox


dlbriggs
May 18th, 1999, 03:27 PM
I have a control that derived from CListBox. Among the other things this control does is OLE drag and drop. So far so good. The control works find if the style is single selection. I have added code so that drag and drop will work with the style of multiple or extented selection. When the style of the control is multiple selection everything is ok. Every time the user click the left mouse button the selection of the item is toggle, and the drag and drop works ok. Now the fun part. When the style of the controle is extented the drag and drop only partly works. When the user selects items with the control key it works well. But when the user selects a range of items with the shift key only one item get drag and drop. The problem is in the function OnLButtonDown where I pick up the data. When I debug into this function all the items in the control that I selected appear selected. But when I call GetSelCount() this function returns 1 telling me that only one item is selected. Somewhere down the line (I looked at OnKillFocus()) the count is correct. Does anyone have an idea how to fix this?
Thanks