0% found this document useful (0 votes)
14 views2 pages

Animation

Uploaded by

ragulr239
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Animation

Uploaded by

ragulr239
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

ANIMATION

Public Class Form1


Dim GoingUp As Boolean
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
GoingUp = True
Timer1.Enabled = True
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button2.Click
GoingUp = False
Timer1.Enabled = True
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Timer1.Tick
If GoingUp = True Then
'move picture box toward the top'
If PictureBox1.Top > 10 Then
PictureBox1.Location = New Point(PictureBox1.Location.X - 10,
PictureBox1.Location.Y - 10)

End If
Else
'move picture box toward the bottom'
If PictureBox1.Top < (Me.Size.Height - 75) Then
PictureBox1.Location = New Point(PictureBox1.Location.X + 10,
PictureBox1.Location.Y + 10)

End If
End If

End Sub
End Class

You might also like