“AddressOf”不能应用于“methodname”,因为“methodname”是分部方法

更新:2007 年 11 月

分部方法已经传递给 AddressOf 运算符。分部方法是 AddressOf 运算符的无效值。

**错误 ID:**BC31440

更正此错误

  • 针对分部方法添加实现方法。实现方法是 AddressOf 运算符的有效值。下面的示例演示分部方法签名及其实现。

    ' Definition of the partial method signature.
    Partial Private Sub OnNameChanged()
        ' The body of the signature is empty.
    End Sub
    
    ' Implementation of the partial method.
    Private Sub OnNameChanged()
        MsgBox("Name was changed to " & Me.Name)
    End Sub
    

请参见

概念

分部方法

参考

AddressOf 运算符