Private Sub picMove_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim newWidth As Integer, newHeight As Integer
If MoveIt = True Then
Select Case Index
Case 0
newHeight = picMove(3).Top - picMove(Index).Top + OldY - Y - picMove(Index).Height
If newHeight >= 195 Then
picMove(Index).Top = picMove(Index).Top + Y - OldY
currControl.Height = newHeight
currControl.Top = picMove(Index).Top + picMove(Index).Height
End If
newWidth = picMove(1).Left + OldX - X - picMove(Index).Left - picMove(Index).Width
If newWidth >= 195 Then
picMove(Index).Left = picMove(Index).Left + X - OldX
currControl.Width = newWidth
currControl.Left = picMove(Index).Left + picMove(Index).Width
End If
picMove(3).Left = picMove(0).Left
picMove(1).Top = picMove(0).Top
Case 1
newHeight = picMove(3).Top - picMove(Index).Top + OldY - Y - picMove(Index).Height
If newHeight >= 195 Then
picMove(Index).Top = picMove(Index).Top + Y - OldY
currControl.Height = newHeight
currControl.Top = picMove(Index).Top + picMove(Index).Height
End If
newWidth = (picMove(Index).Left + X - OldX) - currControl.Left
If newWidth >= 195 Then
picMove(Index).Left = picMove(Index).Left + X - OldX
currControl.Width = newWidth
End If
picMove(2).Left = picMove(1).Left
picMove(0).Top = picMove(1).Top
Case 2
newHeight = (picMove(Index).Top + Y - OldY) - currControl.Top
If newHeight >= 195 Then
picMove(Index).Top = picMove(Index).Top + Y - OldY
currControl.Height = newHeight
End If
newWidth = (picMove(Index).Left + X - OldX) - currControl.Left
If newWidth >= 195 Then
picMove(Index).Left = picMove(Index).Left + X - OldX
currControl.Width = newWidth
End If
picMove(1).Left = picMove(2).Left
picMove(3).Top = picMove(2).Top
Case 3
newHeight = (picMove(Index).Top + Y - OldY) - currControl.Top
If newHeight >= 195 Then
picMove(Index).Top = picMove(Index).Top + Y - OldY
currControl.Height = newHeight
End If
newWidth = picMove(1).Left + OldX - X - picMove(Index).Left - picMove(Index).Width
If newWidth >= 195 Then
picMove(Index).Left = picMove(Index).Left + X - OldX
currControl.Width = newWidth
currControl.Left = picMove(Index).Left + picMove(Index).Width
End If
picMove(0).Left = picMove(3).Left
picMove(2).Top = picMove(3).Top
End Select
End If
End Sub