473,487 Members | 2,680 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Where does DragDrop event come from???

Dan
How do I find out what control a DragDrop event comes from? I initially
presumed that it was the "sender" parameter. But this always seems to be
the destination.

Ie ...

private void listviewMonday_DragDrop (object sender,
System.Windows.Forms.DragEventArgs e)
{
// "sender" always seems to point to "listviewMonday" here.
}
Thanks for any help,
Dan.
Nov 17 '05 #1
3 2421
"Dan" <da*@nospam.com> wrote:
How do I find out what control a DragDrop event
comes from? I initially presumed that it was the
"sender" parameter. But this always seems to be
the destination.


You can control the data that is passed in a drag operation. If you
want to know the source control, pass a reference to that control as
the data.

P.
Nov 17 '05 #2
Dan
> > How do I find out what control a DragDrop event
comes from? I initially presumed that it was the
"sender" parameter. But this always seems to be
the destination.


You can control the data that is passed in a drag operation. If you
want to know the source control, pass a reference to that control as
the data.

Hi. How do I do this? The only place that my DragDrop function is
referenced in code is:

"this.listviewMonday.DragDrop += new
System.Windows.Forms.DragEventHandler(this.listvie wMonday_DragDrop);"

and the main callback function.

Thanks again,
Dan.

Nov 17 '05 #3
"Dan" <da*@nospam.com> wrote:
You can control the data that is passed in a drag
operation. If you want to know the source control,
pass a reference to that control as the data.


Hi. How do I do this? The only place that my DragDrop
function is referenced in code is:
"this.listviewMonday.DragDrop += new [...]


Add a handler to the source control that calls DoDragDrop. Suppose
you're dragging from a ListView control; you might do something like
this:

private void myListView_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
myListView.DoDragDrop(myListView, DragDropEffects.Copy |
DragDropEffects.Move);
}

The first parameter passed to DoDragDrop is the data to be passed to
the target control. In this case, we're passing a reference to
myListView, so that the target control can determine where we dragged
from. You can pass whatever information you want, though.

P.
Nov 17 '05 #4

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

Similar topics

7
5830
by: Kate | last post by:
Hi: I have a form with a picture box and some command buttons to make certain shapes appear in the picture box. The shapes are drawn on blank UserControls added like this: 'at top of form...
2
2312
by: dave | last post by:
I am wishing to drag something from the desktop to a tab of a tab control in vb.net. The dragdrop event fires when release the mouse above the tab however i am having a hard time trying to figure...
4
3952
by: Owe Armandt | last post by:
When I play with DragDrop of files to a form I get two DragEnter events before the DragDrop event, why is this?? Owe
0
1287
by: Flack | last post by:
Hello, Is it possible to find out how many methods are listening to a certain event? For example, if a number of methods subscribed to a controls DragDrop event using +=, can I find out how many...
0
878
by: Sarika | last post by:
Hello all, I have a MDI form w/ a treeview. A splitter control separates the treeview part of the form from the MDI client. (MDI Client is placed on the MDI parent). The client form has a panel...
0
878
by: yuje101 | last post by:
Hi! All I tried to add dragdrop event to one of the widget by using C++ .Net 2003. It seems the event handler did not get called? From one control say listbox to another listbox on the same...
3
1812
by: Jim R | last post by:
I am trying to use Dragdrop event on a control in a VB.NET 2005 app. The app is getting the DragEnter event, but is never getting a DragDrop event. My control has its "AllowDrop" property set to...
1
1588
by: Jeff Williams | last post by:
With a DragDrop event is there a way to determine which control I have droped files onto. ie I have 5 picture boxes on the form. I want to use one dragdrop event and when the drop occurs get...
0
7106
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
6967
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
7181
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...
0
7349
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
5442
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,...
0
3076
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...
0
1381
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 ...
1
600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
267
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.