Hello VBForum
I'm trying do creat a lille puzzel game, and i want to move all picture around, but i can't be true that it is not possible to do the code in a loop
for now i have
And so on .. and so on ..
Anyone there can help me put this into a loop? ;)
I'm trying do creat a lille puzzel game, and i want to move all picture around, but i can't be true that it is not possible to do the code in a loop
for now i have
Code:
Private Sub PictureBox20_MouseMove(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox20.MouseMove
Static mousePosX As Single, mousePosY As Single
If e.Button = 0 Then
mousePosX = e.X
mousePosY = e.Y
Else
PictureBox20.Left = PictureBox20.Left + (e.X - mousePosX)
PictureBox20.Top = PictureBox20.Top + (e.Y - mousePosY)
End If
End Sub
Private Sub PictureBox21_MouseMove(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox21.MouseMove
Static mousePosX As Single, mousePosY As Single
If e.Button = 0 Then
mousePosX = e.X
mousePosY = e.Y
Else
PictureBox21.Left = PictureBox21.Left + (e.X - mousePosX)
PictureBox21.Top = PictureBox21.Top + (e.Y - mousePosY)
End If
End Sub
Private Sub PictureBox22_MouseMove(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox22.MouseMove
Static mousePosX As Single, mousePosY As Single
If e.Button = 0 Then
mousePosX = e.X
mousePosY = e.Y
Else
PictureBox22.Left = PictureBox22.Left + (e.X - mousePosX)
PictureBox22.Top = PictureBox22.Top + (e.Y - mousePosY)
End If
End Sub
Anyone there can help me put this into a loop? ;)