473,765 Members | 1,994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Index FromPoint(Pt)

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

If Index >= 0 Then

frombox3e.DoDra gDrop(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 2516
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.Index FromPoint(Pt)

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

If Index >= 0 Then

frombox3e.DoDra gDrop(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.Index FromPoint(Pt)

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

If Index >= 0 Then

frombox3e.DoDra gDrop(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

"Crouchie19 98" <Cr**********@d iscussions.micr osoft.com> wrote in message
news:ED******** *************** ***********@mic rosoft.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.Index FromPoint(Pt)

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

If Index >= 0 Then

frombox3e.DoDra gDrop(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

"Crouchie19 98" <Cr**********@d iscussions.micr osoft.com> wrote in message
news:ED******** *************** ***********@mic rosoft.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.Index FromPoint(Pt)

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

If Index >= 0 Then

frombox3e.DoDra gDrop(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
4222
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 MultiExtended. Once the selection has been made in the 1st ListBox, the user clicks on a button to generate the arraylist using the values selected. Then click a second button to display the arraylist contents to ListBox2. There are no errors, but all I get...
2
4334
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 there? What about Drag/Drop; is there more than one way for the source to make data available Is it always OLE?
3
10413
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== using System; using System.Drawing; using System.Collections; using System.ComponentModel;
2
3845
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: ------------------------------- ListBoxUser.Location = New System.Drawing.Point(16, 240) ListBoxUser.Name = "ListBoxUser" ListBoxUser.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended ListBoxUser.Size = New System.Drawing.Size(136, 147) ListBoxUser.TabIndex = 6
1
1537
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 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,...
0
1469
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 from the fact that on MouseDown the ListBox changes the highlighting but not the selection collection (it updates the collection on MouseUp) Anyone have any suggestions on how to Drag/Drop from a ListBox with
4
5042
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 of computations, etc). when all of the calculations are complete, I'm trying to change the listbox selection mode from single to MultiExtended, using: myListBox.SelectionMode=SelectionMode.MultiExtended
3
10598
by: VB Programmer | last post by:
In VB.NET 2005 (winform) any sample code to drag & drop items between 2 listboxes? Thanks!
0
1383
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 other listbox display the same text but still have the same value behind. so when i submit the lbTo data should read something like Smith John 7A with a value of 657576 for each person in the lbTo.
0
9393
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10153
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9946
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8830
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7371
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6646
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5272
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.