VB6 - Calculator
All tutorials created in VB6 to be posted in here.
1 post
Page 1 of 1
Hello,
I am going to show you how to make a calculator.
First, set your form up like this:
Next, right click and click View Code
Then, copy and paste all of this in the text field for code:
Enjoy!
~GoodGuy17~
I am going to show you how to make a calculator.
First, set your form up like this:
Next, right click and click View Code
Then, copy and paste all of this in the text field for code:
Code: Select all
Now run it and it should calculate just fine!Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
End Sub
Private Sub Command2_Click()
Text3.Text = Val(Text1.Text) - Val(Text2.Text)
End Sub
Private Sub Command3_Click()
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End Sub
Private Sub Command4_Click()
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
End Sub
Private Sub Form_Load()
Text3.Locked = True
End Sub
Enjoy!
~GoodGuy17~
1 post
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023