Visual Basic has a number of built in functions and constants that you can use. In this lesson, we will look at several that are representative of the functions and constants available to you.
Start a new project and name it Fun. We will add several button as we go along.
We will start with a Label
called LblMessage and a Button
called BtnPI.
Click on BtnPI and write the code as shown below:
Private Sub BtnPI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles BtnPI.Click
Me.LblMessage.Text = "The value of PI is " & System.Math.PI
End Sub
Note that we have used the concatenation operator, &, to paste together the string literal "The value of PI is " and the value of the constant PI.
PI is found by typing System "dot", then selecting Math, another dot and then selecting PI.
If you move the mouse over System.Math.PI and wait for the tool tip you will see the declaration of PI as Double. (Double is a numeric type that includes decimal places.)

Run the program and click the button to see the result displayed in the label.