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

Catching DragDrop when out of the Control

Hi

DragDrop event is fired by the control accepting the drop

If the drop is performed outside the controls I'm watching with events
(like on another control/panel/window or outside my app) is there a
way for me to know about it? (In MFC, for example, mouse movements are
captured)

Or do I just have to follow DragEnter/DragLeave and deduce from that?
Nov 20 '05 #1
3 1629
An object is an object isnt it ?, I mean if you want to determine what
object it is, then examin the sender but you will have to enable Drop in any
control you are interested in.

What are you actually trying to acheive ?
"yuval" <yl****@bigfoot.com> wrote in message
news:c6**************************@posting.google.c om...
Hi

DragDrop event is fired by the control accepting the drop

If the drop is performed outside the controls I'm watching with events
(like on another control/panel/window or outside my app) is there a
way for me to know about it? (In MFC, for example, mouse movements are
captured)

Or do I just have to follow DragEnter/DragLeave and deduce from that?

Nov 20 '05 #2
When a drag starts inside my app, I turn on a 'bool dragging' flag
that causes the GUI to behave somewhat differently.
For example, when dragging over tree nodes I select the node so the
user gets a visual indication. Usually when the tree node changes
selection, the contents of a ListView changes to show items of the
selected node, but when the 'dragging' flag is on, I dont refresh the
ListView (see Windows Explorer).

In order to reset the flag I need to be notified on the drop. The
problem is that DragDrop events does not fire outside the Controls I'm
watching.
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com> wrote in message news:<#E**************@TK2MSFTNGP11.phx.gbl>...
An object is an object isnt it ?, I mean if you want to determine what
object it is, then examin the sender but you will have to enable Drop in any
control you are interested in.

What are you actually trying to acheive ?
"yuval" <yl****@bigfoot.com> wrote in message
news:c6**************************@posting.google.c om...
Hi

DragDrop event is fired by the control accepting the drop

If the drop is performed outside the controls I'm watching with events
(like on another control/panel/window or outside my app) is there a
way for me to know about it? (In MFC, for example, mouse movements are
captured)

Or do I just have to follow DragEnter/DragLeave and deduce from that?

Nov 20 '05 #3
100
Hi yuval,

When the the source knows when the D&D operation ends. The operation is
finished when DoDragDrop returns. In this very spot of your code (right
after DoDragDrop) you have to reset the flag.
If you need to know how the operations has fnished check DragDropEffects
returned by DoDragDrop methos.
None - operation has been canceled;
Copy - objects has been copied;
Move - obejcts has been moved (you should delete the original one)
Link - the targed has created a link to the object

If you need to know whether the data has been dropped *inside* check the
flag if it is set that means *inside*

Anyway I think the right place to reset the flag is right after the
DoDragDrop call regardless whether data has been dropped *inside* or
*outside*

<<Set the flag>>
DoDragDrop(...)
<<Reset the flag>>

HTH
B\rgds
100
"yuval" <yl****@bigfoot.com> wrote in message
news:c6**************************@posting.google.c om...
When a drag starts inside my app, I turn on a 'bool dragging' flag
that causes the GUI to behave somewhat differently.
For example, when dragging over tree nodes I select the node so the
user gets a visual indication. Usually when the tree node changes
selection, the contents of a ListView changes to show items of the
selected node, but when the 'dragging' flag is on, I dont refresh the
ListView (see Windows Explorer).

In order to reset the flag I need to be notified on the drop. The
problem is that DragDrop events does not fire outside the Controls I'm
watching.
"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>

wrote in message news:<#E**************@TK2MSFTNGP11.phx.gbl>...
An object is an object isnt it ?, I mean if you want to determine what
object it is, then examin the sender but you will have to enable Drop in any control you are interested in.

What are you actually trying to acheive ?
"yuval" <yl****@bigfoot.com> wrote in message
news:c6**************************@posting.google.c om...
Hi

DragDrop event is fired by the control accepting the drop

If the drop is performed outside the controls I'm watching with events
(like on another control/panel/window or outside my app) is there a
way for me to know about it? (In MFC, for example, mouse movements are
captured)

Or do I just have to follow DragEnter/DragLeave and deduce from that?

Nov 20 '05 #4

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

Similar topics

7
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...
3
by: yuval | last post by:
Hi DragDrop event is fired by the control accepting the drop If the drop is performed outside the controls I'm watching with events (like on another control/panel/window or outside my app) is...
0
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...
3
by: Dan | last post by:
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...
3
by: Gary Dunne | last post by:
I'm writing an app that requires drag and drop operation between a ListView and a TreeView control. (The source is the ListView). During the drag drop operation I want to be able to detect the...
7
by: JohnR | last post by:
I am using dragdrop to drag and drop a custom class instance. When I drag/drop from one window to another window in the same application everything works fine. But when trying to move between the...
5
by: powella | last post by:
Hello, When I am attempting to start a form (with DragDrop enabled) within a new thread, I get the following exception. This is ONLY the case with ..NET 2.0 and did not occur in 1.1. I...
9
by: DrBonzo | last post by:
Is there any effective difference between doing something in the DragDrop event handler and doing it in the OnDragDrop(.) method of a control? I'm coming from a MFC background and am having a hard...
3
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
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,...
0
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
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,...

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.