なんかちょっと書き方違うな・・・。
検索しようにもわかりません
マウスのボタンが押されてる間動くになってるか。
Public Class Form1ごみが入っていた・・・。Dim PictureBox1の上でマウスのボタンが押された状態 As Boolean = False
Dim PictureBox1の上でマウスのボタンが押された時の座標 As PointPrivate Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles PictureBox1.MouseDownMe.PictureBox1の上でマウスのボタンが押された状態 = True
PictureBox1の上でマウスのボタンが押された時の座標 = e.Location
End Sub
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles PictureBox1.MouseMoveIf Not PictureBox1の上でマウスのボタンが押された状態 Then
Exit Sub
End If
Me.PictureBox1.Location = New Point _
( _
Me.PictureBox1.Location.X + (e.Location.X - PictureBox1の上でマウスのボタンが押された時の座標.X), _
Me.PictureBox1.Location.Y + (e.Location.Y - PictureBox1の上でマウスのボタンが押された時の座標.Y) _
)End Sub
Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles PictureBox1.MouseUpPictureBox1の上でマウスのボタンが押された状態 = False
End Sub
End Class