You are on page 1of 1

Public Class Form1

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


Label4.Text = Now.ToString("D") 'Displays Day & Date
Label5.Text = Now.ToString("hh:mm:ss tt") 'Displays Time
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim a, b, c, d, f, v, w, x, y, z As Double

a = TextBox1.Text 'Values input


b = TextBox2.Text
c = TextBox3.Text
d = TextBox4.Text
f = TextBox5.Text

v = (a * b) 'Calculation formula
w = (c + d + f)
x = (v + w)
y = (x * 0.08)
z = (x + y)

Label16.Text = v.ToString("c") 'Values output in RM


Label17.Text = w.ToString("c")
Label18.Text = x.ToString("c")
Label19.Text = y.ToString("c")
Label20.Text = z.ToString("c")

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


TextBox1.Text = "" 'Clear all values
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""

Label16.Text = ""
Label17.Text = ""
Label18.Text = ""
Label19.Text = ""
Label20.Text = ""
End Sub

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


End 'Exits the program
End Sub

End Class

You might also like