I'm writing a program where I need to "click and drag" labels across the form. I'm planning on doing this by moving them to the position of the cursor. However, I'm having trouble finding the position relative to the top left corner of the form, and regardless of whether or not it is above other objects. Everything I'm finding on the internet is outdated, so if anyone can tell me how to do it in VB.NET 2013, thank you. Also, if there is some easier way to do drag and drop, PLEASE let me know! :P Thanks in advance.

Edited by adam.wolnikowski.9: vb.net version

3 Years
Discussion Span
Last Post by adam.wolnikowski.9
Featured Replies

Minimalist, the code works great, except the Handles clasuses in the sub statements all return errors, any suggestions?


Thats how I handle some of the Addhanlers:

AddHandler lab.Click, AddressOf labMouseClick
                    AddHandler lab.DragEnter, AddressOf labDragEnter
                    AddHandler lab.MouseDown, AddressOf labMouseDown
                    AddHandler lab.DragDrop, AddressOf labDragDrop
                    AddHandler lab.MouseUp, AddressOf labMouseUp
                    AddHandler lab.MouseMove, AddressOf labMouseMove
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.