What you're trying to do is basically a design-time editor.
Override the OnMouseDown method on the Form and based on the X & Y
co-ordinates that come, find out if you hit the button. If you hit the
button, set a boolean flag and keep a local copy of the X & Y co-ordinates.
Now, override the OnMouseMove method. Check if the boolean flag is set. If
set, get the current X & Y co-ordinates and compute the delta between the
old and new co-ordinates. Now, you can move the button delta distance.
Over-ride the OnMouseUp method. Reset the flag.
HTH
-vJ
"MAY" <pa****@hotmail.com> wrote in message
news:er**************@TK2MSFTNGP09.phx.gbl...
Thx for reply :)
If there have form and a button on it, i want the button move with mouse
cursor when mouse down, and the button stop moving when mouse up. How can
i
do that?
thx a lots.
MAY
"MAY" <pa****@hotmail.com> ¦b¶l¥ó
news:%2****************@TK2MSFTNGP11.phx.gbl ¤¤¼¶¼g... hi,
How to get the current mouse position on the screen??
I tried Control.MousePosition.X and Control.MousePosition.Y but fail.
Thanks!
MAY