<Aby zaimplementować metodę "methodname1>", należy zadeklarować metodę "Private", aby zaimplementować metodę częściową "<methodname2>"

Implementacja metody częściowej musi być zadeklarowana Private. Na przykład poniższy kod powoduje ten błąd.

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  

Identyfikator błędu: BC31441

Aby poprawić ten błąd

  1. Użyj modyfikatora Private dostępu w implementacji metody częściowej, jak pokazano w poniższym przykładzie.
Private Sub valueChanged()  
    MsgBox("Value was changed to " & Me.Quantity)  
End Sub  

Zobacz też