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

简介: 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

相关文章
|
索引 Windows
VB编程:Timer控件实例幼儿识字卡片-35
VB编程:Timer控件实例幼儿识字卡片-35
VB编程:利用控件数组设置控件状态-38
VB编程:利用控件数组设置控件状态-38
VB编程:利用CallByName函数对对象进行操作-23
VB编程:利用CallByName函数对对象进行操作-23
144 0
VB编程:巧用常量定义数组-37
VB编程:巧用常量定义数组-37
218 0
VB编程:申明窗体数组-40
VB编程:申明窗体数组-40
117 0
VB编程:利用控件数组设置控件状态
VB编程:利用控件数组设置控件状态
114 0
VB编程:利用控件数组设置控件状态
VB编程:Timer控件中使用计数变量
VB编程:Timer控件中使用计数变量
149 0