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

L'implementazione di un metodo parziale deve essere dichiarata come Private. Il codice seguente, ad esempio, causa 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

  1. Usare 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  

Vedi anche