0% found this document useful (0 votes)
34 views2 pages

Code Calculater

Uploaded by

Raone SRK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views2 pages

Code Calculater

Uploaded by

Raone SRK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Public Class Form1

Dim Number1 As Double


Dim op As String
Private Sub btn1_Click(sender As Object, e As EventArgs) Handles btn1.Click
TextBox1.Text += "1"

End Sub

Private Sub btn2_Click(sender As Object, e As EventArgs) Handles btn2.Click


TextBox1.Text += btn2.Text

End Sub

Private Sub btn3_Click(sender As Object, e As EventArgs) Handles btn3.Click


TextBox1.Text += btn3.Text
End Sub

Private Sub btn4_Click(sender As Object, e As EventArgs) Handles btn4.Click


TextBox1.Text += btn4.Text
End Sub

Private Sub btn5_Click(sender As Object, e As EventArgs) Handles btn5.Click


TextBox1.Text += btn5.Text
End Sub

Private Sub btn6_Click(sender As Object, e As EventArgs) Handles btn6.Click


TextBox1.Text += btn6.Text
End Sub

Private Sub btn7_Click(sender As Object, e As EventArgs) Handles btn7.Click


TextBox1.Text += btn7.Text
End Sub

Private Sub btn8_Click(sender As Object, e As EventArgs) Handles btn8.Click


TextBox1.Text += btn8.Text
End Sub

Private Sub btn9_Click(sender As Object, e As EventArgs) Handles btn9.Click


TextBox1.Text += btn9.Text
End Sub

Private Sub btn0_Click(sender As Object, e As EventArgs) Handles btn0.Click


TextBox1.Text += btn0.Text
End Sub

Private Sub btnplus_Click(sender As Object, e As EventArgs) Handles


btnplus.Click
Number1 = Val(TextBox1.Text)
TextBox1.Text = ""
op = "+"
End Sub

Private Sub btnequal_Click(sender As Object, e As EventArgs) Handles


btnequal.Click
If op = "+" Then
TextBox1.Text = Number1 + Val(TextBox1.Text)
ElseIf op = "-" Then
TextBox1.Text = Number1 - Val(TextBox1.Text)
ElseIf op = "/" Then
TextBox1.Text = Number1 / Val(TextBox1.Text)
ElseIf op = "*" Then
TextBox1.Text = Number1 * Val(TextBox1.Text)
End If

End Sub

Private Sub btnminus_Click(sender As Object, e As EventArgs) Handles


btnminus.Click
Number1 = Val(TextBox1.Text)
TextBox1.Text = ""
op = "-"
End Sub

Private Sub btndivistion_Click(sender As Object, e As EventArgs) Handles


btndivistion.Click
Number1 = Val(TextBox1.Text)
TextBox1.Text = ""
op = "/"
End Sub

End Class

You might also like