Basic Calculator Tutorial in Visual Basic
Basic Calculator Tutorial in Visual Basic
Page3
Go to the code page and add the following declarations:
?
1 Dim value1 As String = ""
2 Dim value2 As String = ""
3 Dim value3 As Double = 0.0
We align the text to be on the right. Right click on the button, click on
properties. In the properties window change TextAlign to MiddleRight:
Choose the box in the middle right (the blue one in the image above)
You also need to change the color of the button. Go to the properties window
and change the backcolor property to white:
There are two more properties you need to
change: TabStop to False and Enabled to False.
Page 2
Page: 1 2 3
Add four more buttons in the same order as shown below and change their
text to 1, 2, 3, -
Add four more buttons in the same order as shown below and change their
text to 0, . , =, +
Add the last two buttons to the calculator in order as shown below and change
their text to Clear, Exit:
Basic Calculator Tutorial in Visual
Basic .NET - Page 3
Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013
Page3
Go to the code page and add the following declarations:
?
1Dim value1 As String = ""
2Dim value2 As String = ""
3Dim value3 As Double = 0.0