Partager via


La méthode '<NomMéthode1>' ne peut pas implémenter de méthode partielle '<NomMéthode2>', car '<NomMéthode3>' l'implémente déjà

Mise à jour : novembre 2007

Message d'erreur

La méthode '<NomMéthode1>' ne peut pas implémenter de méthode partielle '<NomMéthode2>', car '<NomMéthode3>' l'implémente déjà. Seule une méthode peut implémenter une méthode partielle.
Method '<methodname1>' cannot implement partial method '<methodname2>' because '<methodname3>' already implements it. Only one method can implement a partial method.

Vous ne pouvez pas avoir deux méthodes partielles qui implémentent la même déclaration de méthode partielle. Le code suivant provoque cette erreur.

Partial Class Product

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

End Class
Partial Class Product

    ' First implementation of the partial method.
    Private Sub ValueChanged()
        MsgBox(Value was changed to " & Me.Quantity)
    End Sub

    ' Second implementation of the partial method causes this error.
    'Private Sub ValueChanged()
    '    Console.WriteLine("Quantity was changed to " & Me.Quantity)
    'End Sub

End Class

ID d'erreur : BC31434

Voir aussi

Concepts

Méthodes partielles