Using Delegates Across Project Boundaries

Events can be defined and used across project boundaries. An event defined in a class library can be handled in an application making reference to that class and having defined an event handler for the class library event. The net result is that classes don't have to be defined within your application to take advantage of the event mechanism.

Complete the numbered steps.

1.
Create a new blank Windows application project.
2.
Using the Solution Explorer, add a new Class Library project named RaisesEvent to the Windows application solution started in step 1.
3.
Name the class library file RaisesEvent.vb and the class RaiseTest.
4.
Declare an Event attribute by typing Public Event SendString( ByVal Str ...

Get Visual Basic® .NET Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.