'RaiseEvent' method must have the same signature as the containing event's delegate type '<signature>'
A Custom Event
declaration must have RaiseEvent
declaration that has the same signature as the delegate type specified by the custom event's As
clause.
For the signatures to match, the RaiseEvent
declaration and the delegate must have the number of parameters, and the parameters types must match.
Error ID: BC31137
- Change the parameters of the
RaiseEvent
declaration to match the parameters of the delegate type.
This example shows a custom event with the correct parameter types for the RaiseEvent
declaration.
VB
Delegate Sub TestDelegate(ByVal sender As Object, ByVal i As Integer)
Custom Event Test As TestDelegate
AddHandler(ByVal value As TestDelegate)
' Code for adding an event handler goes here.
End AddHandler
RemoveHandler(ByVal value As TestDelegate)
' Code for removing an event handler goes here.
End RemoveHandler
RaiseEvent(ByVal sender As Object, ByVal i As Integer)
' Code for raising an event goes here.
End RaiseEvent
End Event
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: