mickael
Power Member
ora como disse ia fazer um despertador em vb... ja tenho aqui o codigo vejam se ha algo que deva corrigir :
Dim Alarme As Boolean
Private Sub cmdSair_Click()
End
End Sub
Private Sub Form_Load()
lblHoras.Caption = Time$
End Sub
Private Sub optAlarmeOnOff_Click(Index As Integer)
If (Index = 1) Then
Alarme = True
Else
Alarme = False
End If
imgDespertador.Visible = True
End Sub
Private Sub tmrControl_Timer()
If (Time$ > txtHoraDespertar.Text And Alarme) Then
Beep
imgDespertador.Visible = Not imgDespertador.Visible
End If
lblHoras.Caption = Time$
' Outras alternativas para mostrar a data do sistema:
' lblHoras.Caption = Str(Time)
' lblHoras.Caption = Format(Now, "hh:mm:ss")
End Sub
Private Sub txtHoraDespertar_KeyPress(KeyAscii As Integer)
If Not ((KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or (KeyAscii = vbKeyBack) Or (KeyAscii = 58)) Then
Beep
KeyAscii = 0
End If
End Sub
Dim Alarme As Boolean
Private Sub cmdSair_Click()
End
End Sub
Private Sub Form_Load()
lblHoras.Caption = Time$
End Sub
Private Sub optAlarmeOnOff_Click(Index As Integer)
If (Index = 1) Then
Alarme = True
Else
Alarme = False
End If
imgDespertador.Visible = True
End Sub
Private Sub tmrControl_Timer()
If (Time$ > txtHoraDespertar.Text And Alarme) Then
Beep
imgDespertador.Visible = Not imgDespertador.Visible
End If
lblHoras.Caption = Time$
' Outras alternativas para mostrar a data do sistema:
' lblHoras.Caption = Str(Time)
' lblHoras.Caption = Format(Now, "hh:mm:ss")
End Sub
Private Sub txtHoraDespertar_KeyPress(KeyAscii As Integer)
If Not ((KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or (KeyAscii = vbKeyBack) Or (KeyAscii = 58)) Then
Beep
KeyAscii = 0
End If
End Sub