我在visual basic dot net中我有一个图片框,我需要移动它,用户单击并移动鼠标,当用户释放鼠标时,图片框需要随之移动图片框有位置
Public Class Form1
Dim punto As New Point()
Private Sub PictureBox1_MouseDown1(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
punto = Cursor.Position
PictureBox1.Location = punto
End Sub
Private Sub PictureBox1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
punto = Cursor.Position
PictureBox1.Location = punto
End Sub
End Class