Advertisement
jsauto

Timer2_Tick

Mar 31st, 2013
14,500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.62 KB | None | 0 0
  1.  Private Sub Timer2_Tick(sender As System.Object, e As System.EventArgs) Handles   Timer2.Tick
  2.         tb_now.Text = Now
  3.         tb_Date.Text = Now.Date
  4.         .....()
  5.         '檢查checkBox有無打勾
  6.         If CheckBox1.Checked = True Then
  7.             tim1 = Now.TimeOfDay.TotalMinutes
  8.             tim2 = cmb_hour.Text * 60 + cmb_min.Text
  9.             If tim1 >= tim2 Then
  10.                 TextBox1.BackColor = Color.Red
  11.                 TextBox1.Text = "ON"
  12.             Else
  13.                 TextBox1.BackColor = Color.AliceBlue
  14.                 TextBox1.Text = "OFF"
  15.             End If
  16.         End If
  17. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement