Shane Partridge
Visual Basic 2013
The Code
Public Class Form1
'## Maths Functions ##
'## Built-In Mathematical Functions ##
'## Dimension Variables in Public Class ##
Dim Number As Double
Dim AbsValue As Double
Dim DecFormat As String = "##,##.##"
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'## Assigning Value to Variable ##
'## Assign Variable to Label.Text for Formating ##
Number = TextBox1.Text
AbsValue = Math.Abs(Number)
Label4.Text = Format(AbsValue, DecFormat)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Label4.Text = ""
TextBox1.Text = ""
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
'## Assigning Value Label ##
'## Assigning Variable to Label has limited Formatting ##
Number = TextBox1.Text
Label4.Text = Math.Abs(Val(Number))
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Me.Close()
End Sub
End Class