473,809 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
+ 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.DragEvent Args e)
{
// "sender" always seems to point to "listviewMonday " here.
}
Thanks for any help,
Dan.
Nov 17 '05 #1
3 2437
"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.listviewM onday.DragDrop += new
System.Windows. Forms.DragEvent Handler(this.li stviewMonday_Dr agDrop);"

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.listviewM onday.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_Mous eDown(object sender,
System.Windows. Forms.MouseEven tArgs e)
{
myListView.DoDr agDrop(myListVi ew, 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
5849
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 module Dim WithEvents tc As testControl 'button1_click (for example)
2
2343
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 out which tab it was dropped on. Currently i am using the following code but it is not working..Any help would be appreciated... Private Sub tc_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles...
4
3976
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
1326
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 methods in total are listening to the DragDrop event of the control? If I can't find out the exact number of methods listening to the DragDrop event, can I somehow remove all listeners of that event at once? I tried using m_Control.DragDrop =...
0
890
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 control on which I drag and drop treeview items or draw shapes. I have a drop down menu, with a list of items present in the treeview. Clicking on any of the menu items triggers the treeview.DoDragDrop event. Basically this should give me the...
0
887
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 form, the dragdrop event seems IDLE? -- Yuje Peng
3
1836
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 "True". But it seems to me that I am missing something very fundamental. Thanks in advance for any help. Jim
1
1602
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 the controls name like picturebox1. Thanks in advance Jeff
0
9721
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, 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...
0
10376
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
10387
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
10120
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
9200
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
7662
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
6881
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
5550
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...
0
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.