'the following for statements are looped over and over
'and the if...then's are used to relocate the picture once it
'gets out of the screen!
For i = 1 To 10000000
On Command1.Value GoTo exlad
Frame1.Left = Frame1.Left - 100
pause 0.01
If Frame1.Left < -6845 Then
Frame1.Left = Me.Width
End If
Next i
Exit Sub
For i = 1 To 10000000
On Command1.Value GoTo exlad
Frame1.Left = Frame1.Left + 100
pause 0.01
If Frame1.Left > 11520 Then
Frame1.Left = -6845
End If
Next i
Exit Sub
down:
For i = 1 To 10000000
On Command1.Value GoTo exlad
Frame1.Top = Frame1.Top + 100
pause 0.01
If Frame1.Top > 8880 Then
Frame1.Top = -6745
End If
Next i
Exit Sub
For i = 1 To 10000000
On Command1.Value GoTo exlad
Frame1.Top = Frame1.Top - 100
pause 0.01
If Frame1.Top < -6700 Then
Frame1.Top = 8880
End If
Next i
Exit Sub
diag1:
For i = 1 To 10000000
On Command1.Value GoTo exlad
Frame1.Top = Frame1.Top + 100
Frame1.Left = Frame1.Left - 100
pause 0.01
If Frame1.Top > 8880 Then
Frame1.Top = -6700: Frame1.Left = Me.Width
End If
Next i
Exit Sub
diag2:
For i = 1 To 10000000
On Command1.Value GoTo exlad
Frame1.Top = Frame1.Top + 100
Frame1.Left = Frame1.Left + 100
pause 0.01
If Frame1.Top > 8880 Then
Frame1.Top = -6700: Frame1.Left = -6845
End If
Next i
Exit Sub
diag3:
For i = 1 To 10000000
On Command1.Value GoTo exlad
Frame1.Top = Frame1.Top - 100
Frame1.Left = Frame1.Left + 100
pause 0.01
If Frame1.Top < -6700 Then
Frame1.Top = 8880: Frame1.Left = -6845
End If
Next i
Exit Sub
diag4:
For i = 1 To 10000000
On Command1.Value GoTo exlad
Frame1.Top = Frame1.Top - 100
Frame1.Left = Frame1.Left - 100
pause 0.01
If Frame1.Top < -6700 Then
Frame1.Top = 8880: Frame1.Left = Me.Width
End If
Next i
Exit Sub
erhr:
MsgBox "An Error Occured. Please check to see that the picture you chose was NOT directly in a drive, but rather in a folder. This may have caused the error, and if not, then I don't know what to tell you!", vbCritical + vbOKOnly, "Error:"