|
-
May 18th, 2003, 05:53 PM
#1
Thread Starter
Member
Drag and Drop
I have a non-rectangle form without title/caption bar. I wanna allow user to move the form by clicking on anywhere on the form and move it, how do i do that?
Thanks for the help!
-
May 18th, 2003, 07:30 PM
#2
PowerPoster
You are going to probably have to use the mouse down event to enter a loop that polls where the mouse is and move the form.
-
May 18th, 2003, 07:46 PM
#3
Thread Starter
Member
this is what i will do...
Code:
Trap MouseDown:
set a flag stating the mouse is depressed, set the current
position of mouse (properties on the MouseEventArgs object).
Trap MouseMove:
if flag is set, calculate the difference in the current position of the
mouse & the previous position of the mouse and move the form
accordingly. Set previous location to current location.
Trap Mouseup: toggle the flag.
but i dunno how to do this...
set the current
position of mouse (properties on the MouseEventArgs object)
Trap MouseMove: if flag is set, calculate the difference in the
current position of the mouse & the previous position of the
mouse and move the form accordingly. Set previous location to
current location.
Last edited by session; May 18th, 2003 at 07:50 PM.
-
May 19th, 2003, 05:00 AM
#4
Maybe there is an equivalent in C# of catching WM_NCHITTEST?
In any case, you could override PreProcessMessage.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|