dynamicButton.Location = New Point(Me.PictureBox2.PointToClient(MousePosition))
the New point method ask for coordinate or size type, not a point.
You can write :
Code:
dynamicButton.Location = Me.PictureBox2.PointToClient(MousePosition)
or
dynamicButton.Location = New Point(Me.PictureBox2.PointToClient(MousePosition).X,Me.PictureBox2.PointToClient(MousePosition).Y)
The best friend of any programmer is a search engine
"Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
“They did not know it was impossible so they did it” (Mark Twain)
Option Strict on does not cause an error... It reveals your error
Indeed. The error here was that you were trying to create a new Point when you didn't need to. PointToClient returns a Point so why would you need to create a new one at all? Think of all the junky code like this that you might write without it being picked up by the compiler when you have Option Strict Off? In such cases, the system makes a best guess at what you were actually trying to achieve. On many occasions, it will guess correctly. On those that it doesn't get it right, your application will quite possibly just continue chugging along and using the wrong data. That's why you should ALWAYS have Option Strict On and learn how to write good code.