About:
A programme to countdown an amount of seconds, and display a message when the countdown has finished.
Controls:
Format: (see image)
Code:
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Label1.Text = ""
Label2.Text = "Seconds:"
Label3.Text = "Message:"
Button1.Text = "Run"
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Timer1.Interval = Val(TextBox1.Text) * 1000
Timer1.Start()
Label1.Text = "Running for " + TextBox1.Text + " seconds.."
Button1.Enabled = False
TextBox1.Enabled = False
TextBox2.Enabled = false
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Timer1.Stop()
MsgBox(TextBox2.Text)
Label1.Text = ""
Button1.Enabled = True
TextBox1.Enabled = True
TextBox2.Enabled = True
End Sub
End Class
A programme to countdown an amount of seconds, and display a message when the countdown has finished.
Controls:
- 3 Labels
- 2 TextBoxes
- 1 Button
Format: (see image)
Code:
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Label1.Text = ""
Label2.Text = "Seconds:"
Label3.Text = "Message:"
Button1.Text = "Run"
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Timer1.Interval = Val(TextBox1.Text) * 1000
Timer1.Start()
Label1.Text = "Running for " + TextBox1.Text + " seconds.."
Button1.Enabled = False
TextBox1.Enabled = False
TextBox2.Enabled = false
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Timer1.Stop()
MsgBox(TextBox2.Text)
Label1.Text = ""
Button1.Enabled = True
TextBox1.Enabled = True
TextBox2.Enabled = True
End Sub
End Class