By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,979 Members | 1,452 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,979 IT Pros & Developers. It's quick & easy.

Multiple selection in Listbox and left mouse button issue..

P: n/a

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.SelectedItems.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,
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?

Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.