运行效果:
VB编程:Timer控件中使用计数变量-24


程序代码:
Private myint As Integer
Private Sub Form_Load()
    myint = 0
End Sub

Private Sub Timer1_Timer()
    myint = myint + 1
    If myint = 2 Then Me.BackColor = vbGreen
    If myint = 4 Then Me.BackColor = vbRed
    If myint = 6 Then Me.BackColor = vbBlue
    If myint = 10 Then myint = 0
End Sub

相关文章:

  • 2021-12-04
  • 2021-09-09
  • 2021-08-21
  • 2022-12-23
  • 2021-09-15
  • 2021-06-08
  • 2021-07-04
  • 2022-01-31
猜你喜欢
  • 2022-01-16
  • 2021-06-26
  • 2021-06-16
  • 2022-01-11
  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案