You are on page 1of 3

PROGRAMA RESTAR (1)

Private Sub cmdcalcular_Click()


If Val(txvalor1.Text) > Val(txvalor2.Text) Then
lblcontrol.Caption = txvalor1.Text - txvalor2.Text
Else: lblcontrol.Caption = txvalor2.Text - txvalor1.Text
End If
End Sub

Private Sub Command1_Click()


End
End Sub

PROGRAMA PAR O IMPAR (2)


Private Sub Command1_Click()
If Text1.Text Mod 2 = 0 Then
Label2.Caption = " ES PAAAAAR"
Else
Label2.Caption = " ES IMMMMPAAAAAR"
End If

PROGRAMA LADOS DEL TRIANGULO (3)


Private Sub Command1_Click()
c=0
If Val(lado1.Text) = Val(lado2.Text) Then c = c + 1
If Val(lado1.Text) = Val(lado3.Text) Then c = c + 1
If Val(lado2.Text) = Val(lado3.Text) Then c = c + 1
If c = 0 Then Label4.Caption = "escaleno"
If c = 3 Then Label4.Caption = "equilatero"
If c = 1 Then Label4.Caption = "iso"

End Sub

PROGRAMA CALCULAR VECTORIAL (4)


Private Sub Command1_Click()
f=1
For i = 1 To Text1.Text
f=f*i
Next i
Label2.Caption = f

End Sub

PROGRAMA CALCULAR BONO (6)


Private Sub Command1_Click()
SB = NH.Text * VH.Text
bono = SB * 0.13
RESULT.Caption = bono
End Sub

PROGRAMA SEXO NACIONALIDAD (7)


Dim HOMBRES As Integer
Dim MUJERES As Integer
Dim extranjeros As Integer
Dim venezolanos As Integer

Private Sub Command1_Click()


If Option1.Value = True Then
Label2.Caption = "Es mujer"
MUJERES = MUJERES + 1
Else
Label2.Caption = "Es hombre"
HOMBRES = HOMBRES + 1
End If
If Option3.Value = True Then
Label7.Caption = "Venezolano"
venezolanos = venezolanos + 1
Else
Label7.Caption = "Extranjero"
extranjeros = extranjeros + 1
End If
End Sub

Private Sub Command2_Click()


Label2.Visible = False
Label7.Visible = False

Label3.Visible = True
Label4.Visible = True
Label5.Visible = True
Label6.Visible = True

Label3.Caption = MUJERES
Label4.Caption = HOMBRES
Label5.Caption = venezolanos
Label6.Caption = extranjeros

End Sub

Private Sub Form_Load()


Label2.Visible = True
Label3.Visible = True

Label3.Visible = False
Label4.Visible = False
Label5.Visible = False
Label6.Visible = False

End Sub

PROGRAMA CALCULAR PROMEDIO (8)


Private Sub Command1_Click()
PROM = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) +
Val(Text5.Text)
PROMEDIO = PROM / 5
Label5.Caption = PROMEDIO
End Sub

Private Sub Command2_Click()


Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Text5.Text = " "
Label5.Caption = " "

End Sub
PROGRAMA CALCULADORA (5)
Dim pr As Integer
Dim mas As Boolean
Dim menos As Boolean

Private Sub Label1_Click()


Text1.Text = Text1.Text + Label1.Caption
End Sub

Private Sub Label10_Click()


mas = True
menos = False

pr = Text1.Text
Text1.Text = " "

End Sub

Private Sub Label11_Click()


If mas = True Then Text1.Text = pr + Text1.Text
If mas = False Then Text1.Text = pr - Text1.Text
End Sub

Private Sub Label12_Click()


pr = Text1.Text
Text1.Text = " "

End Sub

Private Sub Label2_Click()


Text1.Text = Text1.Text + Label2.Caption
End Sub

Private Sub Label3_Click()


Text1.Text = Text1.Text + Label3.Caption
End Sub

Private Sub Label4_Click()


Text1.Text = Text1.Text + Label4.Caption
End Sub

Private Sub Label5_Click()


Text1.Text = Text1.Text + Label5.Caption
End Sub

Private Sub Label6_Click()


Text1.Text = Text1.Text + Label6.Caption
End Sub

Private Sub Label7_Click()


Text1.Text = Text1.Text + Label7.Caption
End Sub

Private Sub Label8_Click()


Text1.Text = Text1.Text + Label8.Caption
End Sub

Private Sub Label9_Click()


Text1.Text = Text1.Text + Label9.Caption
End Sub

You might also like