How to DragDrop controls not text

  • Thread starter Thread starter Peter Bourget
  • Start date Start date
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 !
 
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..
 
Back
Top