473,396 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Listbox Drag-n-Drop

Can anyone tell the the recommended way of performing mutiple-item drag-n-drop from a MultiExtended listbox?

The problem is the ListBox selection isn't completed in the MouseDown event, when the drag starts, but in the MouseUp which follows. So neither of the following sequences behave as expected:

1) MouseDown Item 1, MouseUp, MouseDown Item 6, Drag, MouseUp

2) MouseDown Item 1, MouseUp, ShiftDown, MouseDown Item 6, Drag, MouseUp, ShiftUp.

Example 1 drags the wrong Item (1 instead of 6)
Example 2 highlights a range but only drags one item.

I tried programattically selecting and deselecting items (depending upon shift, ctrl and button combinations) but it's a lot of code, it still doesn't quite work right, and I'm just duplicating code already written into the ListBox control.

It shouldn't be this hard!

Nov 21 '05 #1
1 1519
Hi,

http://msdn.microsoft.com/library/de...mpDragDrop.asp
Ken
----------------------------
"andrew nott" <an****@radbourne-dot.org> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Can anyone tell the the recommended way of performing mutiple-item
drag-n-drop from a MultiExtended listbox?

The problem is the ListBox selection isn't completed in the MouseDown event,
when the drag starts, but in the MouseUp which follows. So neither of the
following sequences behave as expected:

1) MouseDown Item 1, MouseUp, MouseDown Item 6, Drag, MouseUp

2) MouseDown Item 1, MouseUp, ShiftDown, MouseDown Item 6, Drag, MouseUp,
ShiftUp.

Example 1 drags the wrong Item (1 instead of 6)
Example 2 highlights a range but only drags one item.

I tried programattically selecting and deselecting items (depending upon
shift, ctrl and button combinations) but it's a lot of code, it still
doesn't quite work right, and I'm just duplicating code already written into
the ListBox control.

It shouldn't be this hard!
Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Anjali | last post by:
Hi, I want to implement DragnDrop across th forms of the application. I am able to get some examples to implement DragnDrop across the controls in the same form but I have to implement that...
17
by: amber | last post by:
Hello. Can someone tell me what I may be doing wrong here? I'm using the code (lboxRP is a listbox): Dim newRPindex As Integer newRPindex = Me.lboxRP.FindString(RP)...
3
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name...
2
by: Michael Maercker | last post by:
hi! i come from vb6 and am wondering: what happened to ole_drag/drop? and how can implement dragndrop from the explorer (or any other file list, i.e. winamp) into my listbox in c#? i've done...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
7
by: Dave | last post by:
Hi all, After unsuccessfully trying to make my own dual listbox control out of arraylists, I decided to look for a 3rd party control. I've looked for over a week now and can't find anything but...
1
by: thomasp | last post by:
Has anyone got some sample code to do drag and drop from one listbox to another listbox using VB.Net 2005. The below code works for draging and droping one at a time, but not for multiselected...
3
by: thomasp | last post by:
Has anyone got some sample code to do drag and drop from one listbox to another listbox using VB.Net 2005. The below code works for draging and droping one at a time, but not for multiselected...
2
by: Sam | last post by:
Hi, In my form I have two ToolStripPanels (TSP), one docked on the left, the other docked on the right. Each of those TSP contains a ToolSrip control. I would like to allow the ToolStrips to...
3
by: Ali Chambers | last post by:
Hi, I have created a listbox called "dtlist1" on my VB.NET form. I call a procedure as follows: Private Sub openfile(flname As String) dtlist1.Items.Clear() etc..
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.