Hi下面的代码给了我一个错误,我不太确定如何修复。有人能帮忙吗?
代码:
Public Event hw As EventHandler
Private Sub view_hw(sender As Object, eventArgs As Object)
If hw IsNot Nothing Then
hw.Invoke(Me, New EventArgs())
End If
End Sub
错误:
Error 1 'Public Event hw(sender As Object, e As System.EventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
Public Event hw As EventHandler
Private Sub view_hw(sender As Object, eventArgs As Object)
RaiseEvent hw(Me, New EventArgs())
End Sub