设置定时器的问题? 欢迎低手和高手来讨论!!!
我定义了一个Class1类:
Option Explicit
Public WithEvents tm As Timer
Private Sub tm_Timer()
MsgBox "this is a test", vbOKOnly, "VB"
End Sub
在Form1_Load事件中写入以下代码:
Dim clas As New Class1
clas.tm.Interval = 1000
clas.tm.Enabled = True
运行时出错:
Err.Number = 91
Err.Description = "Object variable or With block variable not set"
请问如何在类模块中设置定时器?