grazie dell' aiuto adesso sto facendo una sveglia ma mi da un errore prova a compilare
(questi sono i nomi)
label: orologio
timer: tempo
label: sveglia
timer: tsveglia
Bottone: Button1
codice:
Public Class Form1
Dim ora As Date
Private Sub tempo_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tempo.Tick
tempo.Interval = 1000
tempo.Enabled = True
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ora = (Hour(TimeOfDay.ToString()) & ":" & Minute(TimeOfDay.ToString()) & ":" & Second(TimeOfDay.ToString()))
orologio.Text = ora
End Sub
Private Sub MonthCalendar1_DateChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar1.DateChanged
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ora = InputBox("Imposta l'Ora di allarme")
If Not IsDate(ora) Then MsgBox("Ora non valida") : Exit Sub
If InStr(1, "/", ora) > 0 Then MsgBox("Inserisci l'ora e non una data") : Exit Sub
sveglia.Text = ora
End Sub
End Class
mi da errore (System.InvalidCastException non è stata gestita)qua
codice:
ora = InputBox("Imposta l'Ora di allarme")