1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
Public Class Form1
Dim blnAlarm As Boolean = False
Dim dateDuJour As Date
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnDemarreTimer.Click
Timer1.Enabled = True
End Sub
Private Sub radioBtnAlarmActive_CheckedChanged(ByVal sender As _
System.Object, ByVal e As System.EventArgs) _
Handles radioBtnAlarmActive.CheckedChanged
If radioBtnAlarmActive.Checked Then
blnAlarm = True
End If
End Sub
Private Sub radioBtnAlarmDesactive_CheckedChanged(ByVal sender As _
System.Object, ByVal e As System.EventArgs) _
Handles radioBtnAlarmDesactive.CheckedChanged
If radioBtnAlarmActive.Checked Then
blnAlarm = False
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Timer1.Tick
lblTempsDuJour.Text = TimeOfDay
dateDuJour = Now
lblDateDuJour.Text = dateDuJour.Date.ToLongDateString
If TextBox1.Text <> "" And TextBox2.Text <> "" And _
TextBox3.Text <> "" Then
Dim AlarmTime = New DateTime(Today.Year, Today.Month, _
Today.Day, CInt(TextBox1.Text), CInt(TextBox2.Text), _
CInt(TextBox3.Text))
If Now > AlarmTime And blnAlarm Then
Beep()
End If
End If
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.lblTempsDuJour.BackColor = Color.AliceBlue
Me.lblTempsDuJour.ForeColor = Color.Red
Me.lblTempsDuJour.Font = New Font("Arial", 16, FontStyle.Italic)
Me.lblDateDuJour.BackColor = Color.AliceBlue
Me.lblDateDuJour.ForeColor = Color.Red
Me.lblDateDuJour.Font = New Font("Arial", 16, FontStyle.Bold)
End Sub
End Class |
Partager