Tema: Reloj fijo
Ver Mensaje Individual
  #22 (permalink)  
Antiguo 24/07/2010, 12:15
Avatar de XYON126
XYON126
 
Fecha de Ingreso: abril-2006
Mensajes: 272
Antigüedad: 18 años
Puntos: 0
Respuesta: Reloj fijo

segundo..
Código vb:
Ver original
  1. 'Funcion para cambiar el color del texto
  2. '###########################################################
  3. Private Sub AjustaColor(Letrero As Label)
  4.   ' Función para unificar y simplificar
  5.  If Letrero.Caption = "ABIERTA" Then
  6.     Letrero.ForeColor = vbGreen
  7.   ElseIf Letrero.Caption = "CERRADA" Then
  8.     Letrero.ForeColor = vbRed
  9.   Else
  10.     Letrero.ForeColor = vbBlack
  11.   End If
  12. End Sub
  13. 'Funcion para activar el color del texto
  14. '###########################################################
  15. Public Function CloseOpen(HoraActual As Date) As String
  16.   If HoraActual > CDate("8:29:59") And HoraActual < CDate("17:29:59") Then
  17.     CloseOpen = "ABIERTA"
  18.   Else
  19.     CloseOpen = "CERRADA"
  20.   End If
  21.  
  22. '--------
  23. If dia = "sábado" Or dia = "domingo" Then CloseOpen = "CERRADA"
  24. '--------
  25.  
  26. End Function
  27.  
  28. 'Funcion para cambiar el color del texto
  29. '###########################################################
  30. Private Sub Label10_Change()
  31.   AjustaColor Label10
  32. End Sub