Image Location -> Mouse Location
Hello, i would like to ask how can u make my picture be in same location as my mouse i tryed like this :
Image.Left = Cursor.Position.X;
Image.Top = Cursor.Position.Y;
But its not really correct cos corsor location isn't exactly there where we see it on our screen we can see it then we change forms location.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

AlanRank #669 · 3.6K reputationPosted Dec 16, 2007, 5:00 AM EST
Well, the Cursor.Position property gives the position in screen co-ordinates whereas the PictureBox's Left and Up properties represent client co-ordinates.
So, I think you need to convert the former to the latter. Something like this, if you're using the top left hand corner of the Picturebox as a reference point:
pictureBox1.Location = this.PointToClient(Cursor.Position);
Marius Hexes3 reputationPosted Dec 16, 2007, 5:11 AM EST