469,354 Members | 2,406 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,354 developers. It's quick & easy.

(moving objects in a form) - reloaded

hello i try to add this code to (mouse down) event of a picturebox1:

picturebox1.location = new point(e.x,e.y)

but i doesnt work, because the picture box sets its location to the mouse
cursors position on the screen, not the position inside the form... how can
ido that? how can i move the picturebox in a form by holding down the left
mouse button and move it and then after release the mouse button?? like
drag&drop but i dnot want to move a data, i want to move a picturebox???
Nov 15 '05 #1
1 1359
You try using ScreenToClient method?

Nick Harris, MCP, CNA, MCSD
Director of Software Services
http://www.VizSoft.net
"Serdar C." <se*****@interaktif.gen.tr> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
hello i try to add this code to (mouse down) event of a picturebox1:

picturebox1.location = new point(e.x,e.y)

but i doesnt work, because the picture box sets its location to the mouse
cursors position on the screen, not the position inside the form... how can ido that? how can i move the picturebox in a form by holding down the left
mouse button and move it and then after release the mouse button?? like
drag&drop but i dnot want to move a data, i want to move a picturebox???

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by A.Kelly | last post: by
2 posts views Thread by Daniel | last post: by
2 posts views Thread by Shapper | last post: by
2 posts views Thread by Diogo Alves - Software Developer | last post: by
2 posts views Thread by (PeteCresswell) | last post: by
1 post views Thread by windandwaves | last post: by
1 post views Thread by Wagz | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.