Visual Basic 6.0 Code

Simple Calculator



Making A Simple Calculator

                        1)text Box

Dim op as string
Dim num1 as Integer
Dim num2 as Integer
Dim num3 as Integer

                       2)Button 

Text1.Text=text1.text & 1

                      3)Clear Button

text1.text= ""

                     4)Opreator Code

num1 =text1.text
text1.text= " "
op= "+"                                (etc...)

                   5)Equal Button

num2=text1.text
text1.text=""
if op = "+" then
num3=num1+num2
text1.text=num3
elseif op = "-" then
num3=num1-num2
text1.text=num3
elseif op = "*" then
num3=num1*num2
text1.text=num3
elseif op = "/" then
num3=num1/num2
text1.text=num3
end if
end sub



Comments

Popular posts from this blog

Super Mario 3 Mario Forever ( GAME )