How to DragDrop controls not text

P

Peter Bourget

Can anyone point me to a good article on using DragDrop with
Windows.Forms.Controls. I am not interested in moving text in ListViews or
anything like that. I want to implement the same functionality as the VS
Forms designer. Move Buttons, TextBoxes etc. Select single or multiple
controls to move.
Thanks !
 
J

Jonne Kats

I don't know a good article, but one way to do it, is to simply trap the
mousedown event, set a mouseDown boolean to true. Trap the mousemove event
and check if mousedown == true, if so set the position of the selected
control according to the mousecoords. Trap the mouseup event and set the
mousedown boolean to false.

HTH..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top