809
社区成员
发帖
与我相关
我的任务
分享
Dim cx As Single, cy As Single
Private Sub Form_Load()
Picture1.Picture = LoadPicture(App.Path & "\temp.jpg")
Picture2.ScaleWidth = Shape1.Width
Picture2.ScaleHeight = Shape1.Height
End Sub
Private Sub Picture1_DragDrop(Source As Control, X As Single, Y As Single)
Source.Move X + cx, Y + cy
Picture2.Cls
Picture2.PaintPicture Picture1.Picture, 0, 0, Shape1.Width, Shape1.Height, X, Y, Shape1.Width, Shape1.Height
Picture2.AutoRedraw = True
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If X >= Shape1.Left And X <= Shape1.Left + Shape1.Width And Y >= Shape1.Top And Y <= Shape1.Top + Shape1.Height Then
cx = Shape1.Left - X
cy = Shape1.Top - Y
Shape1.Drag
End If
End Sub
Dim cx As Single, cy As Single
Private Sub Form_Load()
Picture1.Picture = LoadPicture(App.Path & "\temp.jpg")
Picture2.Width = Shape1.Width
Picture2.Height = Shape1.Height
End Sub
Private Sub Picture1_DragDrop(Source As Control, X As Single, Y As Single)
Source.Move X + cx, Y + cy
Picture2.Cls
Picture2.PaintPicture Picture1.Picture, 0, 0, Shape1.Width, Shape1.Height, X + cx, Y + cy, Shape1.Width, Shape1.Height
Picture2.AutoRedraw = True
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If X >= Shape1.Left And X <= Shape1.Left + Shape1.Width And Y >= Shape1.Top And Y <= Shape1.Top + Shape1.Height Then
cx = Shape1.Left - X
cy = Shape1.Top - Y
Shape1.Drag
End If
End Sub