In this video tutorial you will learn about class level constants. Class-level constants are accessible to all procedures in a class. Local constants have local scope, meaning that each is declared and uses inside a procedure. Local constants are not visible to statements outside the procedure in which they are declared.
A class-level constant is declared inside a class declaration, but not inside any procedure. Class-level constants have class scope because they are visible to all statements inside the class.
Const dbl_PI AsDouble = 3.14159
PrivateSub btnCalculate_Click(sender AsObject, e AsEventArgs) Handles btnCalculate.Click
Dim intRadius AsInteger
Dim dblAreaCircle AsDouble
intRadius = CInt(txtRadius.Text)
dblAreaCircle = intRadius ^ 2 * dbl_PI
lblResult.Text = dblAreaCircle.ToString("n2")
PrivateSub btnNext_Click(sender AsObject, e AsEventArgs) Handles btnNext.Click
lblResult.Text = String.Empty
PrivateSub btnExit_Click(sender AsObject, e AsEventArgs) Handles btnExit.Click