Lengua De Programacion
Private Sub Command5_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text1.SetFocus
End Sub
El botón Sumar
Private Sub Command1_Click()
Text3 = Val(Text1) +Val(Text2)
End Sub
El botón Restar
Private Sub Command2_Click()
Text3 = Val(Text1) - Val(Text2)
End Sub
El botón Multiplicar
Private Sub Command3_Click()
Text3 = Val(Text1) * Val(Text2)
EndSub
El botón Dividir
Private Sub Command4_Click()
Text3 = Val(Text1) / Val(Text2)
End Sub
El botón Salir
Private Sub Command6_Click()
Unload Me
End
End SubEJERCICIO CALCULADORA 2
El botón Calcular
Private Sub Command1_Click()
If Option1 = True Then
Text3 = Val(Text1) / Val(Text2)
ElseIf Option2 =True Then
Text3 = Val(Text1) * Val(Text2)
ElseIf Option3 = True Then
Text3 = Val(Text1) - Val(Text2)
ElseIf Option4 = True Then
Text3 = Val(Text1) + Val(Text2)
End If
End Sub
El botónOtra Operación
Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text1.SetFocus
End Sub
EJERCICIOCONVERSIONES
El botón Convertir
Private Sub Command1_Click()
If Option1 = True Then
Text2 = Val(Text1) * 1000
ElseIf Option2 = True Then
Text2 = Val(Text1) * 100
ElseIf Option3 = True ThenText2 = Val(Text1) * 10
ElseIf Option4 = True Then
Text2 = Val(Text1) / 1000
End If
End Sub
EJERCICIO TABLAS
Elbotón Ver Tabla
Private Sub Command1_Click()
Dim res As Long, retorno
For n = 1 To 10
res = Text1 * n
retorno = Chr(13) & Chr(10)
Text2 = Text2 & Text1 & " x " & n & " = "& res & retorno
Next n
End Sub
El botón Salir
If MsgBox("Por Favor Confirma Si Ya Te Quieres Ir", vbYesNo, "¿Qué Ya Te Quieres Ir?" = vbYes Then
End
Else
Cancel = 1
End If...
Regístrate para leer el documento completo.