Dim w1%, w2%, h1%, h2%, m%, k%, l%
Private Sub Form_Load()
k = Picture99(0).Left
l = Picture99(0).Top
End Sub
Private Sub Picture99_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Index = 0 Then
w1 = X - Picture99(0).Left: w2 = Picture99(0).Left + Picture99(0).Width - X
h1 = Y - Picture99(0).Top: h2 = Picture99(0).Top + Picture99(0).Height - Y
Else
End If
End Sub
Private Sub Picture99_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Index = 0 Then
m = m + 1
If (X - w1 > Shape1.Left And X + w2 < Shape1.Left + Shape1.Width _
And Y - h1 > Shape1.Top And Y + h2 < Shape1.Top + Shape1.Height) Then
Load Picture1(m)
Picture1(m).Left = Shape1.Left + Shape1.Width / 2 - Picture1(m).Width / 2: Picture1(m).Top = Shape1.Top + Shape1.Height / 2 - Picture1(m).Height / 2
ElseIf (X - w1 > Shape2.Left And X + w2 < Shape2.Left + Shape2.Width _
And Y - h1 > Shape2.Top And Y + h2 < Shape2.Top + Shape2.Height) Then
Load Picture2(m)
Picture1(m).Left = Shape2.Left + Shape2.Width / 2 - Picture1(m).Width / 2: Picture1(m).Top = Shape2.Top + Shape2.Height / 2 - Picture1(m).Height / 2
ElseIf (X - w1 > Shape3.Left And X + w2 < Shape3.Left + Shape3.Width _
And Y - h1 > Shape3.Top And Y + h2 < Shape3.Top + Shape3.Height) Then
Load Picture3(m)
Picture1(m).Left = Shape3.Left + Shape3.Width / 2 - Picture1(m).Width / 2: Picture1(m).Top = Shape3.Top + Shape3.Height / 2 - Picture1(m).Height / 2
End If
Picture1(m).Visible = True
If Index > 0 Then
If (X - w1 > Shape1.Left + Shape1.Width Or X + w2 < Shape1.Left _
Or Y - h1 > Shape1.Top + Shape1.Height Or Y + h2 < Shape1.Top) Then
Unload Picture1(Index)
ElseIf (X - w1 > Shape2.Left + Shape2.Width Or X + w2 < Shape2.Left _
Or Y - h1 > Shape2.Top + Shape2.Height Or Y + h2 < Shape2.Top) Then
Unload Picture2(Index)
ElseIf (X - w1 > Shape3.Left + Shape3.Width Or X + w2 < Shape3.Left _
Or Y - h1 > Shape3.Top + Shape3.Height Or Y + h2 < Shape3.Top) Then
Unload Picture3(Index)