You are on page 1of 2

Public Class Form1

Dim botellas, cajas, bot, caj

Private Sub TSINTAPA_Tick(sender As Object, e As EventArgs) Handles TSINTAPA.Tick


BDestapada.Left += 10
If BDestapada.Left >= 347 Then
BDestapada.Visible = False
BTapa.Visible = True
TSINTAPA.Stop()
TCONTAPA.Start()
BDestapada.Location = New Point(34, 143)
End If
End Sub

Private Sub Timer4_Tick(sender As Object, e As EventArgs) Handles Timer4.Tick

End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load


BTapa.Visible = False

End Sub

Private Sub BDestapada_Click(sender As Object, e As EventArgs) Handles BDestapada.Click

End Sub

Private Sub TCONTAPA_Tick(sender As Object, e As EventArgs) Handles TCONTAPA.Tick


BTapa.Left += 10
If BTapa.Left >= 405 Then
TCONTAPA.Stop()
TVertical.Start()
End If
End Sub

Private Sub TVertical_Tick(sender As Object, e As EventArgs) Handles TVertical.Tick


If BTapa.Top < 335 Then
BTapa.Top += 5
BTapa.Left += 5
If BTapa.Top >= 333 Then
bot += 1
Label1.Text = "BOTELLAS: " & bot
BTapa.Location = New Point(347, 143)
BDestapada.Location = New Point(34, 143)
TSINTAPA.Start()
TVertical.Stop()
BTapa.Visible = False
BDestapada.Visible = True
End If
If bot >= botellas Then
bot = 0
caj += 1
End If
End If
End Sub

Private Async Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click


Button3.Visible = False
Await Task.Delay(250)
Button3.Visible = True
If Val(TextBox1.Text) <= 0 Or Val(TextBox2.Text) <= 0 Then
MsgBox("Ingrese un valor valido", , "Advertencia")
Else
Button3.Enabled = False
TSINTAPA.Start()
End If
botellas = Val(TextBox1.Text)
cajas = Val(TextBox2.Text)
botellas = bot
End Sub
End Class

If BTapa.Top < 335 Then


BTapa.Top += 10
BTapa.Left += 10
If BTapa.Top >= 333 Then
bot += 1
Label1.Text = "BOTELLAS: " & bot
BTapa.Location = New Point(347, 143)
BDestapada.Location = New Point(34, 143)
TSINTAPA.Start()
TVertical.Stop()
BTapa.Visible = False
BDestapada.Visible = True
End If
If bot >= botellas Then
bot = 0
caj += 1
End If
End If

You might also like