Во код формы целиком
На ней нужно только picture1 создать!
-------------------------------------------------------------------------
Option Explicit
Dim StartX, StartY As Long
Dim Moving As Boolean
Dim Flag As Single
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
StartX = X
StartY = Y
Moving = True
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
If Moving = True Then
If Picture1.Left + X - StartX + Picture1.Width > Frame1.Width And X - StartX < 0 Or Picture1.Left + X - StartX < Frame1.Width - Frame1.Width And X - StartX > 0 Then
Picture1.Move Picture1.Left + X - StartX, Picture1.Top
End If
If Picture1.Top + Y - StartY + Picture1.Height > Frame1.Height And Y - StartY < 0 Or Picture1.Top + Y - StartY < Frame1.Height - Frame1.Height And Y - StartY > 0 Then
Picture1.Move Picture1.Left, Picture1.Top + Y - StartY
End If
End If
End If
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Moving = False
End If
End Sub