必须将分部方法声明为“Private”

更新:2007 年 11 月

在分部方法声明中需要具有访问修饰符 Private。下面的示例演示如何在方法签名及其实现中使用 Private。

' 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

**错误 ID:**BC31432

更正此错误

  • 在签名和实现声明中将关键字 Private 添加到 Sub 之前。

请参见

概念

分部方法