Open up Visual Studio, and start a new project.
Create a Visual Basic program & make it a "Windows form application".
-Create a Visual Basic program & make it a "Windows form application".
What you need to do:
Drop in 3 labels.
First one: "Enter first number"
Second one: "Enter second number"
and the third one: "Result".
Drop in 4 buttons and name them
1: "Add"
2: "Subtract"
3: "Multiply"
and 4: "Divide"
Then just drop in 3 text boxes.
Put the first label at the top, with a text box under it.
Drop the second label under the first textbox and another text box under the second label.
Then just put the four buttons how ever you like under.
At the bottom put the result label & textbox in together.
Make sure that in the last textbox in the settings you turn ReadOnly to True.
-
iNcase you can't keep up, here's a photo
http ://postimg. org/image/6wb07x90n/
-Drop in 3 labels.
First one: "Enter first number"
Second one: "Enter second number"
and the third one: "Result".
Drop in 4 buttons and name them
1: "Add"
2: "Subtract"
3: "Multiply"
and 4: "Divide"
Then just drop in 3 text boxes.
Put the first label at the top, with a text box under it.
Drop the second label under the first textbox and another text box under the second label.
Then just put the four buttons how ever you like under.
At the bottom put the result label & textbox in together.
Make sure that in the last textbox in the settings you turn ReadOnly to True.
-
iNcase you can't keep up, here's a photo
http ://postimg. org/image/6wb07x90n/
Time for the coding.
Double tap all the buttons, then close the tabs and go back to the original form.
Double tap the form and that should take you to this
http ://postimg. org/image/ih8bd28r7/
-
Under Button1_Click you have to enter in the following code
PHP Code
<?php
Dim a, b, r As Integer
a = Val(Textbox1.Text)
b = Val(Textbox2.Text)
r = a + b
Textbox3.Text = r
-
For button2_Click enter the same code except change a + b to a - b.
:
PHP Code
<?php
Dim a, b, r As Integer
a = Val(Textbox1.Text)
b = Val(Textbox2.Text)
r = a - b
Textbox3.Text = r
Button3_click
PHP Code
<?php
Dim a, b, r As Integer
a = Val(Textbox1.Text)
b = Val(Textbox2.Text)
r = a * b
Textbox3.Text = r
PHP Code
<?php
Dim a, b, r As Integer
a = Val(Textbox1.Text)
b = Val(Textbox2.Text)
r = a / b
Textbox3.Text = r
Full code:
PHP Code
<?php
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim a, b, r As Integer
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
r = a + b
TextBox3.Text = r
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim a, b, r As Integer
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
r = a - b
TextBox3.Text = r
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim a, b, r As Integer
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
r = a * b
TextBox3.Text = r
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim a, b, r As Integer
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
r = a / b
TextBox3.Text = r
End Sub
End Class
END RESULT:
http ://postimg. org/image/vjbx2lp7r/
Thanks for reading :)
If you have any questions (I'm not a pro) feel free to ask! :)
Please leave some feedback if this helped you

