469,904 Members | 1,921 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

Drag drop user controls between forms: getting originator's data

i have a sight problem with detecting the mouse up in a drag-drop outside a form
what i have on my hands is an mdi form with 2 child forms: form1 and form2, both containing a label each. i also have a separate class (global vars) contining static members to pass data between forms.:

MDI parent:
. form1
. form2
. globalvars

. label

. label

. passvalue

i want to drag form1.label to form2.label, and on doing so, the text should get copied

what i'm currently doing is this:
when i click on form1.label, i call its mousedown event, in which i set a globalvars.passvalue to the contents of form1.label
i also initiate DoDragDrop for the label., passing the label as the originator.

when i drop the control on to form2.label, it set;s form2.label.text to globalvars.passvalue

i'd like to know of a better way of doing this, maybe using the DragEventArgs for the DragDrop method for the target?

if not, then how do i catch the Mouseup, if it is anywhere but on form2.label, so as to clear globalvars.passvalue

Oct 26 '06 #1
1 1965
found the solution
i could pass the label's string as the data being passed,instead of the label itself

then get it and convert it back to a stringwith:


im asuming thats the best way?
Oct 26 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by SamSpade | last post: by
3 posts views Thread by Ajay Krishnan Thampi | last post: by
3 posts views Thread by Goldwind | last post: by
5 posts views Thread by Brian Henry | last post: by
reply views Thread by DrBonzo | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.