954,505 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to create Dragable and Resizable control

I have to create a usercontrol which could be dragged over the base form and could be resizable during run time.
Please help me out.

saurabh singh
Newbie Poster
9 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
 

To make a user control dragable or moveble on your forum you should make it using 3 event handlers
1- on mouse click
2- on mouse move
3- on mouse release

first on mouse click begin assgining the location of the control to the x, y of mouse
once user release mouse on the control don't make the mouse x, y = to user control.
I've sample on my pc I've implemented I'll search for you..

Resizable would be the same thinking..

Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 

I have already done this but problem is mouse move event for usercontrol can't displace it with respect to parent form.

saurabh singh
Newbie Poster
9 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
 

And do I assign the control the mouse positions?

beni_dude
Newbie Poster
1 post since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

use also the drag and drop method

jireh
Posting Whiz
316 posts since Jul 2007
Reputation Points: 11
Solved Threads: 49
 

To make a user control dragable or moveble on your forum you should make it using 3 event handlers 1- on mouse click 2- on mouse move 3- on mouse release

first on mouse click begin assgining the location of the control to the x, y of mouse once user release mouse on the control don't make the mouse x, y = to user control. I've sample on my pc I've implemented I'll search for you..

Resizable would be the same thinking..

Oh Ramy, it's a long time, how are you?

Jugortha
Junior Poster
172 posts since Oct 2007
Reputation Points: 11
Solved Threads: 16
 

This is a document within it there is an use cases about the drag and drop controls and how to deal with this

Attachments SampleApps_CSharp_DragDrop.doc (38.5KB)
Jugortha
Junior Poster
172 posts since Oct 2007
Reputation Points: 11
Solved Threads: 16
 

I went back, I was busy last days with my conscription.. thanks for asking :)

Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You