关于raiseevent的使用
本帖最后由 bcrun 于 2012-12-01 12:33:01 编辑 第一次发帖……
我最近要用到raiseevent来触发其他事件。但是触发后事件的内容没有执行。代码如下,望前辈指点一二
Private WithEvents Doit() as dothat
Public Event Doit()
Dim I As Integer
Dim dothat
Private Sub Doit()
Me.Caption = "now event Doit"
MsgBox "look"
End Sub
Private Sub CWButton1_ValueChanged(ByVal Value As Boolean)
If CWButton1.Value = True Then
Timer1.Enabled = True
Else
Timer1.Enabled = False
End If
End Sub
Private Sub Form_Load()
Timer1.Interval = 600
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Time
I = I + 1
If I > 5 Then
RaiseEvent Doit
End If
Me.Caption = I
End Sub