“AddHandler”或“RemoveHandler”语句事件操作数必须是以点限定的表达式或者是简单的名称。

AddHandlerRemoveHandler 的事件参数指定的项未被识别为事件。

错误 ID: BC30677

更正此错误

  • 指定引发事件的对象名称,后跟点 (.) 和事件名称,如以下示例所示。

    VB
    ' Assume that the class Wobject has an event named ThisEvent.
    Dim wObj As New Wobject
    ' Assume that this class has as method named ThisEventHandler.
    AddHandler wObj.ThisEvent, AddressOf Me.ThisEventHandler
    

另请参阅