This document contains the code for an application that simulates bottling beer. It uses timers to animate a bottle cap moving across the screen and then vertically downwards into a box. The code tracks the number of bottles bottled and boxes filled, updating a label with the bottle count. It also contains code to start the animation when a button is clicked, validating the user input for number of bottles and boxes first.
This document contains the code for an application that simulates bottling beer. It uses timers to animate a bottle cap moving across the screen and then vertically downwards into a box. The code tracks the number of bottles bottled and boxes filled, updating a label with the bottle count. It also contains code to start the animation when a button is clicked, validating the user input for number of bottles and boxes first.
This document contains the code for an application that simulates bottling beer. It uses timers to animate a bottle cap moving across the screen and then vertically downwards into a box. The code tracks the number of bottles bottled and boxes filled, updating a label with the bottle count. It also contains code to start the animation when a button is clicked, validating the user input for number of bottles and boxes first.
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