miércoles, 26 de noviembre de 2008
Ascensor de Visual Basic (por Telma)
Private Sub b0_Click()
ascensor.Top = pb.Top + 200
contadorpb.Caption = contadorpb.Caption + 1
End Sub
Private Sub b1_Click()
ascensor.Top = p1.Top + 200
contador1.Caption = contador1.Caption + 1
End Sub
Private Sub b2_Click()
ascensor.Top = p2.Top + 200
contador2.Caption = contador2.Caption + 1
End Sub
Private Sub b3_Click()
ascensor.Top = p3.Top + 200
contador3.Caption = contador3.Caption + 1
End Sub
Private Sub b4_Click()
ascensor.Top = p4.Top + 200
contador4.Caption = contador4.Caption + 1
End Sub
Private Sub b5_Click()
Texto1.Visible = True
enter.Visible = True
contraseña.Visible = True
End Sub
Private Sub enter_Click()
If Texto1 = "1234" Then
ascensor.Top = p5.Top + 200
contador5.Caption = contador5.Caption + 1
Texto1 = ""
End If
End Sub
Private Sub off_Click()
b1.Enabled = False
b2.Enabled = False
b3.Enabled = False
b4.Enabled = False
b5.Enabled = False
b0.Enabled = False
sub0.Enabled = False
ascensor.BackColor = vbBlack
contador1.BackColor = vbBlack
contador2.BackColor = vbBlack
contador3.BackColor = vbBlack
contador4.BackColor = vbBlack
contador5.BackColor = vbBlack
contadorpb.BackColor = vbBlack
contadorss.BackColor = vbBlack
piso5.Enabled = False
piso4.Enabled = False
piso3.Enabled = False
piso2.Enabled = False
piso1.Enabled = False
pb2.Enabled = False
ss2.Enabled = False
reset.Enabled = False
End Sub
Private Sub sub_Click()
ascensor.Top = ss.Top + 200
contadorss.Caption = contadorss.Caption + 1
End Sub
Private Sub on_Click()
b1.Enabled = True
b2.Enabled = Trueb
3.Enabled = True
b4.Enabled = True
b5.Enabled = True
b0.Enabled = True
sub0.Enabled = True
ascensor.BackColor = vbDesktop
contador1.BackColor = vbWhite
contador2.BackColor = vbWhite
contador3.BackColor = vbWhite
contador4.BackColor = vbWhite
contador5.BackColor = vbWhite
contadorpb.BackColor = vbWhite
contadorss.BackColor = vbWhite
piso5.Enabled = True
piso4.Enabled = False
piso3.Enabled = False
piso2.Enabled = False
piso1.Enabled = False
pb2.Enabled = False
ss2.Enabled = False
reset.Enabled = False
End Sub
Private Sub pb2_Click()
ascensor.Top = pb.Top + 200
contadorpb.Caption = contadorpb.Caption + 1
End Sub
Private Sub piso1_Click()
ascensor.Top = p1.Top + 200
contador1.Caption = contador1.Caption + 1
End Sub
Private Sub piso2_Click()
ascensor.Top = p2.Top + 200
contador2.Caption = contador2.Caption + 1
End Sub
Private Sub piso3_Click()
ascensor.Top = p3.Top + 200
contador3.Caption = contador3.Caption + 1
End Sub
Private Sub piso4_Click()
ascensor.Top = p4.Top + 200
contador4.Caption = contador4.Caption + 1
End Sub
Private Sub piso5_Click()
Texto1.Visible = True
enter.Visible = True
contraseña.Visible = True
End Sub
Private Sub reset_Click()
contadorss.Caption = "0"
contadorpb.Caption = "0"
contador1.Caption = "0"
contador2.Caption = "0"
contador3.Caption = "0"
contador4.Caption = "0"
contador5.Caption = "0"
End Sub
Private Sub ss2_Click()
ascensor.Top = ss.Top + 200
contadorss.Caption = contadorss.Caption + 1
End Sub
Private Sub sub0_Click()
ascensor.Top = ss.Top + 200
contador4.Caption = contador4.Caption + 1
End Sub
Private Sub sub0_Click()
ascensor2.Top = pb.Top + 200
contadorpb.Caption = contadorpb.Caption + 1
End Sub
Private Sub b1_Click()
ascensor2.Top = p1.Top + 200
contador1.Caption = contador1.Caption + 1
End Sub
Private Sub b2_Click()
ascensor2.Top = p2.Top + 200
contador2.Caption = contador2.Caption + 1
End Sub
Private Sub b3_Click()
ascensor2.Top = p3.Top + 200
contador3.Caption = contador3.Caption + 1
End Sub
Private Sub b4_Click()
ascensor2.Top = p4.Top + 200
contador4.Caption = contador4.Caption + 1
End Sub
Private Sub b5_Click()
Texto2.Visible = True
enter2.Visible = True
contraseña2.Visible = True
End Sub
Private Sub enter_Click()
If Texto2 = "1234" Then
ascensor2.Top = p5.Top + 200
contador5.Caption = contador5.Caption + 1
Texto2 = ""
End If
End Sub
Private Sub off_Click()
boton1.Enabled = False
boton2.Enabled = False
boton3.Enabled = False
boton4.Enabled = False
boton5.Enabled = False
boton0.Enabled = False
sub0.Enabled = False
ascensor2.BackColor = vbBlack
contador1.BackColor = vbBlack
contador2.BackColor = vbBlack
contador3.BackColor = vbBlack
contador4.BackColor = vbBlack
contador5.BackColor = vbBlack
contadorpb.BackColor = vbBlack
contadorss.BackColor = vbBlack
piso5.Enabled = False
piso4.Enabled = False
piso3.Enabled = False
piso2.Enabled = False
piso1.Enabled = False
pb2.Enabled = False
ss2.Enabled = False
reset2.Enabled = False
End Sub
Private Sub sub_Click()
ascensor2.Top = ss.Top + 200
contadorss.Caption = contadorss.Caption + 1
End Sub
Private Sub on_Click()
boton1.Enabled = True
boton2.Enabled = True
boton3.Enabled = True
boton4.Enabled = True
boton5.Enabled = True
boton0.Enabled = True
sub0.Enabled = True
ascensor2.BackColor = vbDesktop
contador1.BackColor = vbWhite
contador2.BackColor = vbWhite
contador3.BackColor = vbWhite
contador4.BackColor = vbWhite
contador5.BackColor = vbWhite
contadorpb.BackColor = vbWhite
contadorss.BackColor = vbWhite
piso5.Enabled = True
piso4.Enabled = False
piso3.Enabled = False
piso2.Enabled = False
piso1.Enabled = False
pb2.Enabled = False
ss2.Enabled = False
reset2.Enabled = False
End Sub
Private Sub pb2_Click()
ascensor2.Top = pb.Top + 200
contadorpb.Caption = contadorpb.Caption + 1
End Sub
Private Sub piso1_Click()
ascensor2.Top = p1.Top + 200
contador1.Caption = contador1.Caption + 1
End Sub
Private Sub piso2_Click()
ascensor2.Top = p2.Top + 200
contador2.Caption = contador2.Caption + 1
End Sub
Private Sub piso3_Click()
ascensor2.Top = p3.Top + 200
contador3.Caption = contador3.Caption + 1
End Sub
Private Sub piso4_Click()
ascensor2.Top = p4.Top + 200
contador4.Caption = contador4.Caption + 1
End Sub
Private Sub piso5_Click()
Texto2.Visible = True
enter2.Visible = True
contraseña2.Visible = True
End Sub
Private Sub reset_Click()
contadorss.Caption = "0"
contadorpb.Caption = "0"
contador1.Caption = "0"
contador2.Caption = "0"
contador3.Caption = "0"
contador4.Caption = "0"
contador5.Caption = "0"
End Sub
Private Sub ss2_Click()
ascensor2.Top = ss.Top + 200
contadorss.Caption = contadorss.Caption + 1
End Sub
Private Sub sub0_Click()
ascensor2.Top = ss.Top + 200
contador4.Caption = contador4.Caption + 1
End Sub
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario