Use a Picturebox or an Image Control
NOTE: If your Picturebox has it's ScaleMode = vbPixels then don't use the Screen.TwipsPerPixelX and Screen.TwipsPerPixelYCode:Dim nX As Single Dim nY As Single Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) nX = X / Screen.TwipsPerPixelX nY = Y / Screen.TwipsPerPixelY End Sub Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then Image1.Move Image1.Left + ((X / Screen.TwipsPerPixelX)) - nX, Image1.Top + ((Y / Screen.TwipsPerPixelY)) - nY End If End Sub Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) nX = X / Screen.TwipsPerPixelX nY = Y / Screen.TwipsPerPixelY End Sub Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then Picture1.Move Picture1.Left + ((X / Screen.TwipsPerPixelX)) - nX, Picture1.Top + ((Y / Screen.TwipsPerPixelY)) - nY End If End Sub




Reply With Quote