In a Visual Basic .NET application, is there a way to use Handles
on an object referenced in a DLL written in C#? Compiling the code gives me the error:
'Handles' in modules must specify a 'WithEvents' variable qualified with a single identifier.
I'm writing the Visual Basic .NET application, but I do have the source code of the C# library available.
My current code looks something like this:
WithEvents Friend Module As ModuleNamespace.Module
Sub EventHandler() Handles Module.Events.Event1
Console.WriteLine("Event1 fired.")
End Sub
Replacing Module
, ModuleNamespace
, and Event1
with the actual names.