Visual Basic Tutorial #1 | Calculator
How to make your own calculator
What you are making:
Difficulty: Very easy
Time: 5-10 minutes
Time: 5-10 minutes
Step 1:
Create a New Project -> Windows Forms Application
Step 2:
Create:
4 Buttons
2 Labels
2 Text Box
Step 3:
Rename the buttons to +, -, x, /
Move the two text box's to the top
Click the labels and remove the text saying Label.
You should have something looking like this.
Do that to both, put one in-between the two Text box's and the other where you would like the answer to show.
Should look something like this.
Step 4: Coding:
Double click the + button
It should open up this.
Add this code:
Code (Text):
Label2.Text = "+"
Label1.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
Codes for other buttons
Step 5:
Check the error list:
If there are 0 then you can go ahead and test it out.
Click the debug button.
Now try it out and you may need to move the labels so it looks good.
Then you are done!
0 comments