i have two listboxes, lbData and lbTo. i need to drag and drop between the two.
lbData.datasour ce = 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.
i currently have a drag and drop code but it dont let me drop onto lbTo it appears with a circle with a line through it. - private void lbData_MouseDown(object sender, MouseEventArgs e)
-
{
-
-
lbData.DoDragDrop(lbData.Text, DragDropEffects.Move);
-
-
-
}
-
-
private void lbData_DragEnter(object sender, DragEventArgs e)
-
{
-
if(e.Data.GetDataPresent(DataFormats.Text))
-
{
-
e.Effect = DragDropEffects.Move;
-
}
-
else
-
{
-
e.Effect = DragDropEffects.None;
-
}
-
}
-
private void lbData_DragDrop(object sender, DragEventArgs e)
-
{
-
lbData.Text = (string)e.Data.GetData(DataFormats.Text);
-
}
also it may be useful for you to know the listbox properties so here they are. - //
-
// lbData
-
//
-
this.lbData.AllowDrop = true;
-
this.lbData.Location = new System.Drawing.Point(8, 120);
-
this.lbData.Name = "lbData";
-
this.lbData.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
-
this.lbData.Size = new System.Drawing.Size(184, 342);
-
this.lbData.TabIndex = 9;
-
this.lbData.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lbData_MouseDown);
-
this.lbData.DragDrop += new System.Windows.Forms.DragEventHandler(this.lbData_DragDrop);
-
this.lbData.DragEnter += new System.Windows.Forms.DragEventHandler(this.lbData_DragEnter);
-
//
-
// lbTo
-
//
-
this.lbTo.AllowDrop = true;
-
this.lbTo.Location = new System.Drawing.Point(216, 120);
-
this.lbTo.Name = "lbTo";
-
this.lbTo.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
-
this.lbTo.Size = new System.Drawing.Size(184, 342);
-
this.lbTo.TabIndex = 10;
what will i ahve to do to modify this code to work how i need?
All answers are greatly apprecieated.
Many Thanks,
Piercy
0 1385 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Karuppasamy |
last post by:
Hi
In a Windows Applications, i want to drag and drag multiple items between
two Listboxes.
Is it possible to drag and drop multiple items?
If yes, how to do that?
Waiting for your reply.
|
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;
|
by: James Radke |
last post by:
Hello,
I was curious, is it possible to create drag and drop interface from listbox
to listbox on a webform application (i.e. vb.net)? Basically the
application would need to load multiple listboxes with values from a
database, allow the user to drag and drop from a listbox to a different
listbox and would 'move' the item and update the database accordingly?
If so, would anyone have any examples of how to do this?
|
by: James Allen Bressem |
last post by:
I was searching through the MSDN documentation trying to figure out how to
do drag n drop and I found a sample program. The sample program did all
sorts of fancy junk like dynamically create it's user controls etc. (pomp -
is it really necessary to be so gaudy when trying to explain a simple
point?) So, realizing the state of the economy and the period of history in
which I was so unfortunately born, I spent the next 3 or so hours weeding...
|
by: Sam |
last post by:
Hi,
I've done the method described here :
http://64.78.52.104/FAQ/WinForms/FAQ_c87c.asp#q565q
It works well for items added at design time. However if my source list
is filled with a datasource, the items are properly displayed but the
method
private void OnDragEnter(object sender,
| |
by: Dwayne Gaddy |
last post by:
Hey all,
I have a windows form with a list boxes. I have data binded the list boxes
with data from my sql database. I want to use drag and drop to allow users
to choose different options from the list boxes on the form and drag them
into another empty list box that is not bound to any data when the form
loads. I was wondering is it possible to use drag and drop with data binded
list boxes ? If it is possible do you know of any place on...
|
by: VB Programmer |
last post by:
In VB.NET 2005 (winform) any sample code to drag & drop items between 2
listboxes? Thanks!
|
by: Full NameEntry |
last post by:
Hi all,
I'm new to csharp... learning it by muddling my way though examples.
In my current example, I'm trying to make a form with a bunch of
listboxes that have drag and drop enabled amongst them...
I found an example online in the form of a DragNDrop.cs file that I've
included in my project (attached below).
|
by: CNemo |
last post by:
Hello friends!
I need to do subj and VS03. No Atlas or something like this.
Would be great if somebody may share a small sample how to do it.
What i have in mind is like:
1. Create hidden field to hold source control name.
2. When mouse down, store name in this control.
3. Drag.
4. When drop, do postback from target control.
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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,...
| |
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...
|
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,...
|
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...
|
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...
|
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...
|
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: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |