Escolar Documentos
Profissional Documentos
Cultura Documentos
Private Sub cmdcerrar_Click() frmmenucal.Show End Sub Private Sub cmddia_Click() Dim x As
Integer x = InputBox("dame un numero") If (x = 1) Then MsgBox ("es lunes") ElseIf (x = 2) Then
MsgBox ("es martes") ElseIf (x = 3) Then MsgBox ("es miercoles") ElseIf (x = 4) Then MsgBox
("es jueves") ElseIf (x = 5) Then MsgBox ("es viernes") ElseIf (x = 6) Then MsgBox ("es sabado")
ElseIf (x = 7) Then MsgBox ("es domingo") Else MsgBox "ese dia no existe", vbCritical, "error"
End If End Sub
y = InputBox("dame otro numero") If (x >= 0) Then r = x + y MsgBox "tu resultado es " & r,
vbExclamation, "jugando" If (y < 0) Then r = y * 2 MsgBox "tu resultado es" & r, vbExclamation,
"jugando" ElseIf (x = y) Then r = x * y MsgBox "tu resultado es:" & r, vbExclamation, "jugando"
Else End If End If End Sub
Caluladora
Dim x As Integer Dim op As Integer Dim r As Double Private Sub cmdcero_Click() txtpantalla.Text
= txtpantalla.Text & 0 End Sub Private Sub cmdcerrar_Click() frmmenucal.Show
calculadora12.Hide End Sub Private Sub cmdcinco_Click() txtpantalla.Text = txtpantalla.Text &
5End Sub Private Sub cmdclean_Click() txtpantalla = " " End Sub Private Sub cmdcuatro_Click()
txtpantalla.Text = txtpantalla.Text & 4 End Sub Private Sub cmddos_Click() txtpantalla.Text =
txtpantalla.Text & 2 End Sub Private Sub cmdentre_Click() x = txtpantalla.Text op = 4
txtpantalla.Text = " " End Sub Private Sub cmdigual_Click() If (op = 1) Then r = x +
txtpantalla.Text txtpantalla.Text = r ElseIf (op = 2) Then r = x * txtpantalla.Text
txtpantalla.Text = r ElseIf (op = 3) Then r = x - txtpantalla.Text txtpantalla.Text = r Else r = x /
txtpantalla.Text txtpantalla.Text = r End If End Sub Private Sub cmdmas_Click() x =
txtpantalla.Text op = 1 txtpantalla.Text = " " End Sub Private Sub cmdmenos_Click() x =
txtpantalla.Text op = 3 txtpantalla.Text = " " End Sub Private Sub
cmdnueve_Click()txtpantalla.Text = txtpantalla.Text & 9 End Sub Private Sub cmdocho_Click()
txtpantalla.Text = txtpantalla.Text & 8 End Sub Private Sub cmdpunto_Click() txtpantalla.Text =
txtpantalla.Text & "." End Sub Private Sub cmdpor_Click() x = txtpantalla.Text op = 2
txtpantalla.Text = " " End Sub Private Sub cmdseis_Click() txtpantalla.Text = txtpantalla.Text & 6
End Sub Private Sub cmdsiete_Click() txtpantalla.Text = txtpantalla.Text & 7 End Sub