SlideShare a Scribd company logo
Public Class Form1
Dim total As Double
Dim total1 As Double
Dim operation As String

Private Sub zero_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
zero.Click
TextBox1.Text = TextBox1.Text & zero.Text
End Sub

Private Sub one_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
one.Click
TextBox1.Text = TextBox1.Text & one.Text
End Sub

Private Sub two_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
two.Click
TextBox1.Text = TextBox1.Text & two.Text
End Sub

Private Sub three_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
three.Click
TextBox1.Text = TextBox1.Text & three.Text
End Sub

Private Sub four_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
four.Click
TextBox1.Text = TextBox1.Text & four.Text
End Sub

Private Sub five_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
five.Click
TextBox1.Text = TextBox1.Text & five.Text
End Sub

Private Sub six_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
six.Click
TextBox1.Text = TextBox1.Text & six.Text
End Sub

Private Sub seven_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
seven.Click
TextBox1.Text = TextBox1.Text & seven.Text
End Sub

Private Sub eight_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
eight.Click
TextBox1.Text = TextBox1.Text & eight.Text
End Sub

Private Sub nine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
nine.Click
TextBox1.Text = TextBox1.Text & nine.Text
End Sub

Private Sub plus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
plus.Click
operation = "+"
total = total + Val(TextBox1.Text)
TextBox1.Text = " "
End Sub

Private Sub Mul_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Mul.Click
operation = "*"
total = total + Val(TextBox1.Text)
TextBox1.Text = " "
End Sub

Private Sub equal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
equal.Click
If operation = "+" Then
total1 = total + Val(TextBox1.Text)
total = 0

ElseIf operation = "*" Then
total1 = total * Val(TextBox1.Text)
total = 0

ElseIf operation = "-" Then
total1 = total - Val(TextBox1.Text)
total = 0

ElseIf operation = "" Then
total1 = total  Val(TextBox1.Text)
total = 0

End If
TextBox1.Text = total1.ToString()
End Sub

Private Sub minus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
minus.Click
operation = "-"
total = total + Val(TextBox1.Text)
TextBox1.Text = " "
End Sub

Private Sub div_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
div.Click
operation = ""
total = total + Val(TextBox1.Text)
TextBox1.Text = " "
End Sub

Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Cancel.Click
TextBox1.Text = " "
End Sub

Private Sub CE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
CE.Click
TextBox1.Text = ""
total1 = 0
End Sub

Private Sub dot_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
dot.Click
TextBox1.Text = TextBox1.Text & "."
End Sub
End Class

More Related Content

PDF
Inventory management
DOC
Elementos del lenguaje
PPTX
Colegio municipal
PDF
Linear Search Program in Visual Basic 2008
PDF
Binary Search Program in Visual Basic 2008
DOCX
Código Editor Net
DOCX
.net progrmming part4
PDF
Ejercicio sql server vs visual .net
Inventory management
Elementos del lenguaje
Colegio municipal
Linear Search Program in Visual Basic 2008
Binary Search Program in Visual Basic 2008
Código Editor Net
.net progrmming part4
Ejercicio sql server vs visual .net

What's hot (20)

PDF
Bhanu Pratap Singh Shekhawat, BCA Third Year
PDF
How to become an Android dev starting from iOS (and vice versa)
DOC
PDF
C++ Windows Forms L02 - Controls P1
DOCX
Docimp
PDF
How to Write Better Code with Mutation Testing
DOC
Ficha tecnica
DOCX
Ete programs
DOCX
Ensayo Convergencia Informatica
PDF
C++ Windows Forms L09 - GDI P2
DOCX
Punto fijo multivariante
DOCX
Codes
PPTX
My.setting tutorial
PDF
Stop watch and array
PPTX
Rx 101 Codemotion Milan 2015 - Tamir Dresher
PPTX
Mule esb object_to_jackson_json
PPTX
Building responsive application with Rx - confoo - tamir dresher
PDF
Kajal Gaharwal , BCA Third Year
DOC
PDF
Rakesh Bijawat , BCA Third Year
Bhanu Pratap Singh Shekhawat, BCA Third Year
How to become an Android dev starting from iOS (and vice versa)
C++ Windows Forms L02 - Controls P1
Docimp
How to Write Better Code with Mutation Testing
Ficha tecnica
Ete programs
Ensayo Convergencia Informatica
C++ Windows Forms L09 - GDI P2
Punto fijo multivariante
Codes
My.setting tutorial
Stop watch and array
Rx 101 Codemotion Milan 2015 - Tamir Dresher
Mule esb object_to_jackson_json
Building responsive application with Rx - confoo - tamir dresher
Kajal Gaharwal , BCA Third Year
Rakesh Bijawat , BCA Third Year
Ad

Viewers also liked (20)

DOCX
Customer relationship management
DOCX
Human resource management
PDF
Rajeev oops 2nd march
PDF
P 10 p-4ac756g50(gb )
DOC
RECENT TRENDS OF MAINTENANCE MANAGEMENT
PDF
Declaring friend function with inline code
DOCX
Production and materials management
PDF
Final pl doc
DOCX
Ergonomics
PDF
Order specification sheet
DOCX
Material requirement planning
DOC
SETTING UP OF A GARMENT INDUSTRY
PDF
Shirt spec sheet
PDF
Maintenance management
PDF
Graduation Project (SA 8000 & it's frame work for Indian Apparel Manufacturing)
DOC
PAD FINAL DOC
DOCX
DOC
Garment inspection report_dn1_page_2
PDF
Customer relationship management
Human resource management
Rajeev oops 2nd march
P 10 p-4ac756g50(gb )
RECENT TRENDS OF MAINTENANCE MANAGEMENT
Declaring friend function with inline code
Production and materials management
Final pl doc
Ergonomics
Order specification sheet
Material requirement planning
SETTING UP OF A GARMENT INDUSTRY
Shirt spec sheet
Maintenance management
Graduation Project (SA 8000 & it's frame work for Indian Apparel Manufacturing)
PAD FINAL DOC
Garment inspection report_dn1_page_2
Ad

Similar to Calculator code (20)

DOC
Calculadora
DOCX
Código Acerca Editor_Net
PPTX
Latihan visual basic 2010/Looping/Perulangan
DOCX
Ejercicio de Visual Basic IF THEN ELSE
PDF
Federico landinez docx
PDF
Guevara rene if then., else
DOCX
Federico landinez docx
DOCX
Federico landinez docx
DOCX
Christian rodriguez then else
PDF
Parra maxi IF THEN ELSE
DOC
Correction s+ rie_vb
PDF
PROGRAMA DE EJEMPLO
PDF
Trabajo de case
PDF
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
PDF
Trabajo de case
PDF
Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdf
TXT
PPTX
Reservasi hotel
PPTX
Vs c# lecture2
PPTX
Vp lecture 4 ararat
Calculadora
Código Acerca Editor_Net
Latihan visual basic 2010/Looping/Perulangan
Ejercicio de Visual Basic IF THEN ELSE
Federico landinez docx
Guevara rene if then., else
Federico landinez docx
Federico landinez docx
Christian rodriguez then else
Parra maxi IF THEN ELSE
Correction s+ rie_vb
PROGRAMA DE EJEMPLO
Trabajo de case
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
Trabajo de case
Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdf
Reservasi hotel
Vs c# lecture2
Vp lecture 4 ararat

More from Rajeev Sharan (20)

PPT
Supply chain management
PPT
Production module-ERP
PPT
Supply chain management
PPS
E smartx.ppt
PPTX
Maintenance management
PPSX
Maintenance management
PPSX
product analysis & development- sourcing
PPTX
Product Analysis & Development
PPT
Ergonomics
PPTX
Total service management
PPTX
Lean- automobile
PPT
PPT
PDF
INVENTORY OPTIMIZATION
PPTX
Professional practices
PPT
Report writing.....
PPTX
Business ethics @ tata
PPTX
Software maintenance
PPT
Software quality assurance
Supply chain management
Production module-ERP
Supply chain management
E smartx.ppt
Maintenance management
Maintenance management
product analysis & development- sourcing
Product Analysis & Development
Ergonomics
Total service management
Lean- automobile
INVENTORY OPTIMIZATION
Professional practices
Report writing.....
Business ethics @ tata
Software maintenance
Software quality assurance

Recently uploaded (20)

PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Cell Types and Its function , kingdom of life
PPTX
master seminar digital applications in india
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
Yogi Goddess Pres Conference Studio Updates
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Lesson notes of climatology university.
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Cell Types and Its function , kingdom of life
master seminar digital applications in india
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Supply Chain Operations Speaking Notes -ICLT Program
202450812 BayCHI UCSC-SV 20250812 v17.pptx
GDM (1) (1).pptx small presentation for students
Weekly quiz Compilation Jan -July 25.pdf
Yogi Goddess Pres Conference Studio Updates
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
STATICS OF THE RIGID BODIES Hibbelers.pdf
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
A systematic review of self-coping strategies used by university students to ...
O5-L3 Freight Transport Ops (International) V1.pdf
Lesson notes of climatology university.
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx

Calculator code

  • 1. Public Class Form1 Dim total As Double Dim total1 As Double Dim operation As String Private Sub zero_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles zero.Click TextBox1.Text = TextBox1.Text & zero.Text End Sub Private Sub one_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles one.Click TextBox1.Text = TextBox1.Text & one.Text End Sub Private Sub two_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles two.Click TextBox1.Text = TextBox1.Text & two.Text End Sub Private Sub three_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles three.Click TextBox1.Text = TextBox1.Text & three.Text End Sub Private Sub four_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles four.Click TextBox1.Text = TextBox1.Text & four.Text End Sub Private Sub five_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles five.Click TextBox1.Text = TextBox1.Text & five.Text End Sub Private Sub six_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles six.Click TextBox1.Text = TextBox1.Text & six.Text End Sub Private Sub seven_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles seven.Click TextBox1.Text = TextBox1.Text & seven.Text End Sub Private Sub eight_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles eight.Click TextBox1.Text = TextBox1.Text & eight.Text End Sub Private Sub nine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nine.Click TextBox1.Text = TextBox1.Text & nine.Text End Sub Private Sub plus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles plus.Click operation = "+"
  • 2. total = total + Val(TextBox1.Text) TextBox1.Text = " " End Sub Private Sub Mul_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Mul.Click operation = "*" total = total + Val(TextBox1.Text) TextBox1.Text = " " End Sub Private Sub equal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles equal.Click If operation = "+" Then total1 = total + Val(TextBox1.Text) total = 0 ElseIf operation = "*" Then total1 = total * Val(TextBox1.Text) total = 0 ElseIf operation = "-" Then total1 = total - Val(TextBox1.Text) total = 0 ElseIf operation = "" Then total1 = total Val(TextBox1.Text) total = 0 End If TextBox1.Text = total1.ToString() End Sub Private Sub minus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles minus.Click operation = "-" total = total + Val(TextBox1.Text) TextBox1.Text = " " End Sub Private Sub div_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles div.Click operation = "" total = total + Val(TextBox1.Text) TextBox1.Text = " " End Sub Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click TextBox1.Text = " " End Sub Private Sub CE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CE.Click TextBox1.Text = "" total1 = 0 End Sub Private Sub dot_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dot.Click
  • 3. TextBox1.Text = TextBox1.Text & "." End Sub End Class