# Formulas Para Calculadora En Visual Basic

Páginas: 2 (271 palabras) Publicado: 2 de mayo de 2012
Variables:

Dim OP As String
Dim a, b, resultado As Double
Dim c As Double

Numeros:

1:
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "1"c = False

2:
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "2"
c = False

3:
If c = True Then
Text1.Text = ""
End If
Text1.Text =Text1.Text + "3"
c = False

4:
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "4"
c = False

5:
If c = True Then
Text1.Text = ""
End IfText1.Text = Text1.Text + "5"
c = False

6:
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "6"
c = False

7:
If c = True Then
Text1.Text = ""
EndIf
Text1.Text = Text1.Text + "7"
c = False

8:
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "8"
c = False

9:
If c = True Then
Text1.Text= ""
End If
Text1.Text = Text1.Text + "9"
c = False

0:
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "0"
c = False

Suma:
a = Text1.Text
Text1.Text = ""
OP = "SUMA"

Resta:
a = Text1.Text
Text1.Text = ""
OP = "RESTA"

Multiplicación:
a = Text1.Text
Text1.Text = ""OP = "MULTIPLICACION"

DIVISION:
a = Text1.Text
Text1.Text = ""
OP = "DIVISION"

FORMULA IGUAL:

b = Val(Text1.Text)
Select Case OP
Case "SUMA"
Case "RESTA"
Case "MULTIPLICACION"
Case "DIVISION"resultado = a / b
End Select

FORMULA PUNTO :

Text1.Text = Text1.Text + "."

FORMULA DE BORRAR CE

Text1.Text = ""

FORMULA DE OFF:

END

Regístrate para leer el documento completo.