HELP: Drag & Drop

Souma

Member
Joined
Apr 27, 2005
Messages
7
Programming Experience
Beginner
Hi,

Currently i'm working on my own little program called the network map designer. I managed to do the drag and drop for the first label i added, but when i add a second label (drag and drop still works) the first label is stuck and it is not able to drag and drop anymore. My aim is: regardless of the number of labels i added, all of them should be able to drag and drop to move around the form.

I've attached my uncompleted program to give you a clearer picutre.


I need help solving this problem. Greatly appreciated, thanks in advance.


PS: Need to see my codes, PM me
 

Attachments

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
i can see the problem you're talking about, but without some code i dont know how to help ya right off hand
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
none that i can think of right off hand, now that my finals are taken (yea... college) i might have some time here to look into it further
 

Souma

Member
Joined
Apr 27, 2005
Messages
7
Programming Experience
Beginner
got ya dude~! Focus on ur final :) Good luck
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
i've been playing with this for the better part of 2 hours now and i know what i want it to do but i dont know why it's not working

what i want it to do is in the form's mousedown event get the label and store the reference in the ctrlControl variable so that in the form's mousemove event the label will move with the mouse here's what i got, if anyone else can help that'd be much appreciated i'll start researching drag&drop stuff tomarrow (time permitting)
 

Souma

Member
Joined
Apr 27, 2005
Messages
7
Programming Experience
Beginner
Hmm... the one u attached doesn't seems to be able to move the label about, and it's like totally different from mine :p , but still nvm at least u tried :D thanks~! I still working on it for quite a few days now lol still can't get it...

Is it possible to click and drag from TreeView to form/panel? How can i do it?
 
Last edited:

Souma

Member
Joined
Apr 27, 2005
Messages
7
Programming Experience
Beginner
Good piece of news~! I got it working :)
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
awsome, how'd you get it working out of curiosity?

and my approach was:
since the labels were being added to the form in code i'd have to use the form's mousedown/mousemove events to "grab" any control that's at that spot, but as you saw it wasnt working
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
awsome, i learned something today :)
 
Top Bottom