Can somebody give me some hints on how to stop the that thing that is moving on the screen. For example I made the classic ball in the box, where the ball bounces off the perimeter.
How would I make the ball stop as in freeze when I click a button.
Any help would be great
Private Sub start_Click()
Dim Start As Integer
Dim nd As Integer
Dim changex As Integer
Dim changey As Integer
Dim x As Double
Start = 0
nd = 0
changex = 50
changey = 50
Do
ball.Left = ball.Left + changex
If ball.Left + ball.Width > Picture1.Width Then
changex = changex * -1
ElseIf ball.Left < 0 Then
changex = changex * -1
End If
ball.Top = ball.Top + changey
If ball.Top + ball.Height > Picture1.Height Then
changey = changey * -1
ElseIf ball.Top < 0 Then
changey = changey * -1
End If
For x = 0 To 1000
DoEvents
Next x
Loop
End Sub
This is the code