Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Try
Dim p As Point = Me.PointToClient(Me.MousePosition)
b.Location = New Point(p.X, p.Y)
Catch ex As Exception
End Try
End Sub
Empty catch block? : p
b.Location = Me.PointToClient(Me.MousePosition) // No temporary variable needed, tho it may add clarity.
I'd have used Form_MouseMove instead of timer1, but you specifically said you did it that way on purpose, so, agree to disagree.
edit:
Code:
Dim p As Point = Me.PointToClient(Me.MousePosition)
b.Location = New Point(p.X, p.Y)
Even if you decided to use the temp. variable, you could still just directly assign it to b.location, no need to create
another point.
Code:
Dim p As Point = Me.PointToClient(Me.MousePosition)
b.Location = p
Un-needed optimizations as it apparently works as-is, but it doesn't hurt to keep in mind.