Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving object @ runtime
Message
From
04/01/2007 11:00:38
 
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01181851
Message ID:
01182261
Views:
10
>You forgot to mention to make sure that the drop target must have the AllowDrop property enabled. I spent a long time wondering why I couldn't drop yesterday :)

Yeah, thanks for reminding me ... I obviously had that in my code, but I just forgot to mention it. I'll add it to my notes that I keep for answering such questions. =0)

The PointToClient in your code was very useful as DragDrop's e.X and e.Y are a lot different from MouseUp's e.X and e.Y.

Yep. Another useful method if you need to actually *get* the object at that point is the .GetChildAtPoint() method (this would be *where* the Dragged-in control is being dropped, like say you were dropping the actual Text from one TextBox to another ... not applicable in the example we were doing however):
	Point xy = this.TargetArea.PointToClient(new Point(e.X, e.Y));
	Control ToControl = this.TargetArea.GetChildAtPoint(pt);
But where are you using MouseUp? You're using MouseDown to start the DragDrop aren't you?

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform