Posted by: warunaprabath | August 31, 2009

How to create normal calculator

waruna


This Visual Basic Code

Private Sub Command1_Click ()
Dim x As Double
Dim y As Double
Dim z As Double
x = Val(Text1.Text)
y = Val(Text2.Text)
z = x + y
Text3.Text = Val(z)
End Sub
Private Sub Command2_Click ()
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
End Sub
Private Sub Command3_Click ()
Dim x As Double
Dim y As Double
Dim z As Double
x = Val(Text1.Text)
y = Val(Text2.Text)
z = x – y
Text3.Text = Val(z)
End Sub
Private Sub Command4_Click ()
Dim x As Double
Dim y As Double
Dim z As Double
x = Val(Text1.Text)
y = Val(Text2.Text)
z = x / y
Text3.Text = Val(z)
End Sub
Private Sub Command5_Click ()
Dim x As Double
Dim y As Double
Dim z As Double
x = Val(Text1.Text)
y = Val(Text2.Text)
z = x * y
Text3.Text = Val(z)
End Sub
Private Sub Command6_Click ()
End
End Sub

Responses

  1. Great!! Keep it up malli! Good luck!


Leave a response

Your response:

Categories