Il metodo '<nomemetodo1>' deve essere dichiarato 'Private' per implementare il metodo parziale '<nomemetodo2>'

Aggiornamento: novembre 2007

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

L'implementazione di un metodo parziale deve essere dichiarata Private. Nel codice seguente, ad esempio, viene generato questo errore.

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 errore: BC31441

Per correggere l'errore

  • Utilizzare il modificatore di accesso Private nell'implementazione del metodo parziale, come mostrato nell'esempio seguente.

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

Vedere anche

Concetti

Metodi parziali

Livelli di accesso in Visual Basic