Private Sub HS1_Change()
If Pp1.Width - Abs(Pp1.Left) - P1.Width > 0 Then
Pp1.Left = -HS1.Value
ElseIf Pp1.Width - Abs(Pp1.Left) - P1.Width < 0 Then
Pp1.Left = HS1.Value
ElseIf Pp1.Width - Abs(Pp1.Left) - P1.Width = 0 Then
If HS1.Value <> 1 Then
Pp1.Left = Pp1.Left + (HS1.Max - HS1.Value)
Else
Pp1.Left = 0
End If
End If
End Sub
Private Sub VS1_Change()
If Pp1.Height - Abs(Pp1.Top) - P1.Height > 0 Then
Pp1.Top = -VS1.Value
ElseIf Pp1.Height - Abs(Pp1.Top) - P1.Height < 0 Then
Pp1.Top = VS1.Value
ElseIf Pp1.Height - Abs(Pp1.Top) - P1.Height = 0 Then
If VS1.Value <> 1 Then
Pp1.Top = Pp1.Top + (VS1.Max - VS1.Value)
Else
Pp1.Top = 0
End If
End If
End Sub