VB编程:Timer控件中使用计数变量

简介: VB编程:Timer控件中使用计数变量

程序代码:

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

相关文章
|
7月前
|
C语言
C语言计数控制循环的深入解析
C语言计数控制循环的深入解析
170 0
VB编程:Timer控件中使用计数变量-24
VB编程:Timer控件中使用计数变量-24
100 0
VB编程:利用控件数组设置控件状态-38
VB编程:利用控件数组设置控件状态-38
104 0
|
索引 Windows
VB编程:Timer控件实例幼儿识字卡片-35
VB编程:Timer控件实例幼儿识字卡片-35
VB编程:申明窗体数组-40
VB编程:申明窗体数组-40
121 0
VB编程:利用CallByName函数对对象进行操作-23
VB编程:利用CallByName函数对对象进行操作-23
151 0
VB编程:利用控件数组设置控件状态
VB编程:利用控件数组设置控件状态
116 0
VB编程:利用控件数组设置控件状态