473,326 Members | 2,680 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,326 software developers and data experts.

drag/drop from listbox to listbox, but multiextended mode

I've been able to get a pair of listboxes to pass data from one to the other
successfully, but only one selected item at a time. If I change the listbox
mode of both the multiextended, it only passes the item (point) from which
the drag begins. Here's some of the relevant code:
Dim Pt As New Point(e.X, e.Y)

Dim Index As Integer

' Determines which item was selected.

frombox3e = sender

Index = frombox3e.IndexFromPoint(Pt)

' Starts a drag-and-drop operation with that item.

If Index >= 0 Then

frombox3e.DoDragDrop(frombox3e.Items(Index), DragDropEffects.Move)

End If

How can this code be modified to accommodate the selection of all the items
selected, whether by single, multisimple of multiextended mode?

Tx for any help.

Bernie Yaeger


Nov 21 '05 #1
4 2498
Instead of using 'point' to get the item, try the ListBox's 'SelectedIndex'
instead.

"Bernie Yaeger" wrote:
I've been able to get a pair of listboxes to pass data from one to the other
successfully, but only one selected item at a time. If I change the listbox
mode of both the multiextended, it only passes the item (point) from which
the drag begins. Here's some of the relevant code:
Dim Pt As New Point(e.X, e.Y)

Dim Index As Integer

' Determines which item was selected.

frombox3e = sender

Index = frombox3e.IndexFromPoint(Pt)

' Starts a drag-and-drop operation with that item.

If Index >= 0 Then

frombox3e.DoDragDrop(frombox3e.Items(Index), DragDropEffects.Move)

End If

How can this code be modified to accommodate the selection of all the items
selected, whether by single, multisimple of multiextended mode?

Tx for any help.

Bernie Yaeger


Nov 21 '05 #2
Instead of using 'point' to get the item, try the ListBox's 'SelectedIndex'
instead.

"Bernie Yaeger" wrote:
I've been able to get a pair of listboxes to pass data from one to the other
successfully, but only one selected item at a time. If I change the listbox
mode of both the multiextended, it only passes the item (point) from which
the drag begins. Here's some of the relevant code:
Dim Pt As New Point(e.X, e.Y)

Dim Index As Integer

' Determines which item was selected.

frombox3e = sender

Index = frombox3e.IndexFromPoint(Pt)

' Starts a drag-and-drop operation with that item.

If Index >= 0 Then

frombox3e.DoDragDrop(frombox3e.Items(Index), DragDropEffects.Move)

End If

How can this code be modified to accommodate the selection of all the items
selected, whether by single, multisimple of multiextended mode?

Tx for any help.

Bernie Yaeger


Nov 21 '05 #3
Hi Crouchie,

Interesting idea - tx; I'll try it.

Bernie

"Crouchie1998" <Cr**********@discussions.microsoft.com> wrote in message
news:ED**********************************@microsof t.com...
Instead of using 'point' to get the item, try the ListBox's
'SelectedIndex'
instead.

"Bernie Yaeger" wrote:
I've been able to get a pair of listboxes to pass data from one to the
other
successfully, but only one selected item at a time. If I change the
listbox
mode of both the multiextended, it only passes the item (point) from
which
the drag begins. Here's some of the relevant code:
Dim Pt As New Point(e.X, e.Y)

Dim Index As Integer

' Determines which item was selected.

frombox3e = sender

Index = frombox3e.IndexFromPoint(Pt)

' Starts a drag-and-drop operation with that item.

If Index >= 0 Then

frombox3e.DoDragDrop(frombox3e.Items(Index), DragDropEffects.Move)

End If

How can this code be modified to accommodate the selection of all the
items
selected, whether by single, multisimple of multiextended mode?

Tx for any help.

Bernie Yaeger


Nov 21 '05 #4
Hi Crouchie,

Interesting idea - tx; I'll try it.

Bernie

"Crouchie1998" <Cr**********@discussions.microsoft.com> wrote in message
news:ED**********************************@microsof t.com...
Instead of using 'point' to get the item, try the ListBox's
'SelectedIndex'
instead.

"Bernie Yaeger" wrote:
I've been able to get a pair of listboxes to pass data from one to the
other
successfully, but only one selected item at a time. If I change the
listbox
mode of both the multiextended, it only passes the item (point) from
which
the drag begins. Here's some of the relevant code:
Dim Pt As New Point(e.X, e.Y)

Dim Index As Integer

' Determines which item was selected.

frombox3e = sender

Index = frombox3e.IndexFromPoint(Pt)

' Starts a drag-and-drop operation with that item.

If Index >= 0 Then

frombox3e.DoDragDrop(frombox3e.Items(Index), DragDropEffects.Move)

End If

How can this code be modified to accommodate the selection of all the
items
selected, whether by single, multisimple of multiextended mode?

Tx for any help.

Bernie Yaeger


Nov 21 '05 #5

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

Similar topics

2
by: Fieldmedic | last post by:
I'm attempting to get an arraylist to display in a Listbox (listbox2). The arraylist is created from selections in a different listbox (listbox1). The 1st listbox has a selection mode of...
2
by: SamSpade | last post by:
There seems to be two ways to put things on the clipboard ( I don't mean different formats): SetClipboardData and OleSetClipboard If I want to get data off the clipboard do I care how it was put...
3
by: Ajay Krishnan Thampi | last post by:
I have a slight problem implementing 'drag and drop' from a datagrid to a tree-view. I have pasted my code below. Someone please advice me on what to do...pretty blur right now. ==code== ...
2
by: tangokilo | last post by:
Hello and thanks for your help, I have the following Listbox created in VisualStudio 2003 designer, desiring to select multiple entries from that list: -------------------------------...
1
by: andrew nott | last post by:
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...
0
by: **Developer** | last post by:
Has anyone found out how to do DragDrop from a ListBox with SelectionMode.MultiExtended I've been searching Google and see that it is an old problem. I know from past experience that it stems...
4
by: lgbjr | last post by:
Hi All, I've got a listbox on a VB.NET form. when the form opens, the ListBox SelectionMode is set to Single. while running various routines on the form, items get added to the list box (results...
3
by: VB Programmer | last post by:
In VB.NET 2005 (winform) any sample code to drag & drop items between 2 listboxes? Thanks!
0
by: piercy | last post by:
i have two listboxes, lbData and lbTo. i need to drag and drop between the two. lbData.datasource = tblfilter; i need to be able to drag and drop the data from one to the other then on the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.