Skip to main content

VB: Alarm Clock

About:
A program to replicate an alarm clock. The user enters a time, and the programme will display a MessageBox when the alarm hits.

Controls:
  • 4  Labels
  • 1  Textbox
  • 1  Button

Format: (See image)















Code:
Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label1.Text = "Time"
        Label2.Text = "Alarm"
        Label3.Text = ""
        Label4.Text = ""
    End Sub
    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        Label3.Text = TimeOfDay
        If Label4.Text = Label3.Text Then
            Label4.Text = ""
            MsgBox("Alarm Message!")
        End If
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Label4.Text = TextBox1.Text
    End Sub
End Class

Popular posts from this blog

C# Unity: AI Loop Waypoint System

For a looped waypoint system in Unity, attach this C# script to a game object which you want to move. Enter a number in 'size' under Points. This is the number of waypoints which you want the car to hit. The last waypoint does NOT need to be the first waypoint. In Unity, set up waypoint game objects with a collider, with 'is trigger' checked (like below). Script: public List points = new List (); public GameObject currentPoint; public GameObject nextpoint; int current = 0; float speed, defaultSpeed; void Start () {    currentPoint = points[current];    nextpoint = points[current +1];    defaultSpeed = 4.3f;    speed = defaultSpeed; } void Update () {    transform.position = Vector3.MoveTowards(transform.position, nextpoint.transform.position, speed * Time.deltaTime);    if(current < points.Count)    {       currentPoint = points[current];   ...

VB: Countdown

About: 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: