473,503 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dragn'drop between user controls

Hi,
I've created a simple user control (System.Windows.Forms.UserControl) in c#.
Then I place two items of this control on a form. After this I try to drag
one control to the other and try to catch the OnDragEnter event. This
doesn't work.

My question is, how should I do this? If I try to drag a file from the file
explorer over my control the event is raised, but not if I drag my own
control.

Any help is highly appreciated.

Thanks,

Mats-Lennart
Nov 16 '05 #1
1 1046
For once I actually solved the problem on my own :)

To be able to drag a control, you must use the DoDragDrop method to
initialize the dragging.

/Mats-Lennart
"Mats-Lennart Hansson" <ap********@hotmail.com> wrote in message
news:eU**************@tk2msftngp13.phx.gbl...
Hi,
I've created a simple user control (System.Windows.Forms.UserControl) in c#. Then I place two items of this control on a form. After this I try to drag
one control to the other and try to catch the OnDragEnter event. This
doesn't work.

My question is, how should I do this? If I try to drag a file from the file explorer over my control the event is raised, but not if I drag my own
control.

Any help is highly appreciated.

Thanks,

Mats-Lennart

Nov 16 '05 #2

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

Similar topics

42
1996
by: Mike P. | last post by:
Hello I come from the world of C++ programming, and I'm used to writing programs that are actually executed by the CPU, and that run with some semblance of performance. I have taken the time to...
9
2106
by: Ingo Nolden | last post by:
Hi there, I am writing c++ for some months now. I think I know the language now, but not yet all the tricky things of stl. For a kernel which is not using mfc I am writing a serialization. For...
0
7093
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
7348
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...
1
7006
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...
1
5021
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...
0
3175
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
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1519
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
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
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.