Multiple selection in Listbox and left mouse button issue..

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • AK

    Multiple selection in Listbox and left mouse button issue..

    Hello,

    Listbox mulitselect property is set to true (extended).

    I am trying to implement drag and drop feature for a listbox. The drag &
    drop is done in the mouse move event (DoDragdrop function is called in mouse
    move event). I am facing two problems:
    1. First is that when shift key is pressed and left mouse button is down.
    The listbox does not give the correct count of selected items. It gives only
    one item as selected (listbox1.Selec tedItems.count) .
    2. Second problem is that when left mouse button is pressed and is kept
    pressed, all the previous selection is undone and the item which is at mouse
    pointer becomes selected. For example, if i have 6 items in the listbox,
    list1
    list2
    list3
    list4
    list5
    list6
    Now if I selected list2, list3 and list4. Now if the mouse pointer is
    pointing to list4 item and I press left mouse button the selection should
    remain (like it does in windows explorer) but the oppsite happens selections
    goes and list4 item is selected.

    Can any one throw some light how to overcome this?

    Thanks,


Working...