Private Sub Timer2_Tick(sender As System.Object, e As System.EventArgs) Handles Timer2.Tick
tb_now.Text = Now
tb_Date.Text = Now.Date
.....(略)
'檢查checkBox有無打勾
If CheckBox1.Checked = True Then
tim1 = Now.TimeOfDay.TotalMinutes
tim2 = cmb_hour.Text * 60 + cmb_min.Text
If tim1 >= tim2 Then
TextBox1.BackColor = Color.Red
TextBox1.Text = "ON"
Else
TextBox1.BackColor = Color.AliceBlue
TextBox1.Text = "OFF"
End If
End If
End Sub