다음을 통해 공유


부분 메서드(Partial Method) '<methodname2>'을(를) 구현하려면 '<methodname1>' 메서드를 'Private'으로 선언해야 합니다.

업데이트: 2007년 11월

Method '<methodname1>' must be declared 'Private' in order to implement partial method '<methodname2>'

부분 메서드의 구현은 Private으로 선언해야 합니다. 예를 들어 다음 코드는 이 오류를 발생시킵니다.

Partial Class Product

    ' Declaration of the partial method.
    Partial Private Sub valueChanged()
    End Sub

End Class
Partial Class Product

    ' Implementation of the partial method, with Private missing, 
    ' causes this error. 
    'Sub valueChanged()
    '    MsgBox(Value was changed to " & Me.Quantity)
    'End Sub

End Class

오류 ID: BC31441

이 오류를 해결하려면

  • 다음 예제와 같이 부분 메서드 구현에서 Private 액세스 한정자를 사용합니다.

    Private Sub valueChanged()
        MsgBox(Value was changed to " & Me.Quantity)
    End Sub
    

참고 항목

개념

부분 메서드

Visual Basic의 액세스 수준