This will make a command button bounce on the form and it fits to the forms width and height when y
This will make a command button bounce on the form and it fits to the forms width and height when you resize it.
API Declarations
Extra:
Command button is the object that bounces, change it if you want.
Also you can add more objects and make them bounce but for each object you will need 4 timers
Rate This will make a command button bounce on the form and it fits to the forms width and height when y
(1(1 Vote))
Command1.Left = Command1.Left + 100
If Command1.Left >= Me.Width - Command1.Width - 100 Then
Timer1.Enabled = False
Timer2.Enabled = True
End If
End Sub
Private Sub Timer2_Timer()
Command1.Left = Command1.Left - 100
If Command1.Left <= 0 Then
Timer1.Enabled = True
Timer2.Enabled = False
End If
End Sub
Private Sub Timer3_Timer()
Command1.Top = Command1.Top + 100
If Command1.Top >= Me.Height - Command1.Height - Command1.Height - 175 Then
Timer3.Enabled = False
Timer4.Enabled = True
End If
End Sub
Private Sub Timer4_Timer()
Command1.Top = Command1.Top - 100
If Command1.Top <= 0 Then
Timer3.Enabled = True
Timer4.Enabled = False
End If
End Sub
This will make a command button bounce on the form and it fits to the forms width and height when y Comments
No comments yet — be the first to post one!
Post a Comment