Eso tarde en hacerla, juaaaaaaaaaa, quizas, menos, recuerdo tenía al pequeño Daniel en brazos, mientras, programaba esta Calculadora
Para ver este enlace Registrate o Inicia SesionCodigo Fuente
Public valorini As Double
Public valorfin As Double
Public ante As Double
Public opera As Integer
Public topera As String
Public memor As Double
Public num As Integer
Private Sub boton_Click(Index As Integer)
Select Case Index
Case 0
If opera <> 0 Then
Tbtexto.Text = ""
Tbtexto = Tbtexto & boton(0).Caption
opera = 0
Else
Tbtexto = Tbtexto & boton(0).Caption
End If
Case 1
If opera <> 0 Then
Tbtexto.Text = ""
Tbtexto = Tbtexto & boton(1).Caption
opera = 0
Else
Tbtexto = Tbtexto & boton(1).Caption
End If
Case 2
If opera <> 0 Then
Tbtexto.Text = ""
Tbtexto = Tbtexto & boton(2).Caption
opera = 0
Else
Tbtexto = Tbtexto & boton(2).Caption
End If
Case 3
If opera <> 0 Then
Tbtexto.Text = ""
Tbtexto = Tbtexto & boton(3).Caption
opera = 0
Else
Tbtexto = Tbtexto & boton(3).Caption
End If
Case 4
If opera <> 0 Then
Tbtexto.Text = ""
Tbtexto = Tbtexto & boton(4).Caption
opera = 0
Else
Tbtexto = Tbtexto & boton(4).Caption
End If
Case 5
If opera <> 0 Then
Tbtexto.Text = ""
Tbtexto = Tbtexto & boton(5).Caption
opera = 0
Else
Tbtexto = Tbtexto & boton(5).Caption
End If
Case 6
If opera <> 0 Then
Tbtexto.Text = ""
Tbtexto = Tbtexto & boton(6).Caption
opera = 0
Else
Tbtexto = Tbtexto & boton(6).Caption
End If
Case 7
If opera <> 0 Then
Tbtexto.Text = ""
Tbtexto = Tbtexto & boton(7).Caption
opera = 0
Else
Tbtexto = Tbtexto & boton(7).Caption
End If
Case 8
If opera <> 0 Then
Tbtexto.Text = ""
Tbtexto = Tbtexto & boton(8).Caption
opera = 0
Else
Tbtexto = Tbtexto & boton(8).Caption
End If
Case 9
If opera <> 0 Then
Tbtexto.Text = ""
Tbtexto = Tbtexto & boton(9).Caption
opera = 0
Else
Tbtexto = Tbtexto & boton(9).Caption
End If
Case 10
num = Len(Tbtexto.Text)
Tbtexto.Text = Mid(Tbtexto, 1, num - 1)
Case 11
valorini = 0
memor = 0
Tbtexto.Text = ""
Case 12
valorini = Tbtexto.Text
opera = 1
topera = "/"
Case 13
valorini = Tbtexto.Text
opera = 1
topera = "+"
Case 14
valorini = Tbtexto.Text
opera = 1
topera = "-"
Case 15
ante = Tbtexto.Text
valorini = Tbtexto.Text
opera = 1
topera = "*"
Case 16
If topera = "/" Then
valorfin = valorini / Tbtexto.Text
Tbtexto.Text = valorfin
ElseIf topera = "+" Then
valorfin = valorini + Tbtexto.Text
Tbtexto.Text = valorfin
ElseIf topera = "-" Then
valorfin = valorini - Tbtexto.Text
Tbtexto.Text = valorfin
ElseIf topera = "*" Then
valorfin = valorini * Tbtexto.Text
Tbtexto.Text = valorfin
End If
valorini = 0
Case 17
memor = 0
Case 18
memor = Tbtexto.Text
Case 19
Tbtexto = Tbtexto & "."
Case 20
Tbtexto = Tbtexto & ","
Case 21
Tbtexto.Text = (Tbtexto.Text * 100) / ante
Case 22
Tbtexto.Text = memor
End Select
End Sub
Private Sub Form_Activate()
Tbtexto.SetFocus
opera = 0
End Sub
Private Sub Form_Load()
'tbtexto.SetFocus
End Sub
saludos,