
Events across VB projects
Rocky,
There does appear to be a problem there when using multiple projects.
I managed to work around it by either declaring the event as one of the
standard delegates. So instead of...
Public Event Click(sender As Object, e As System.EventArgs)
...use...
Public Event Click As System.EventHandler
Or if custom parameters are required, declare a Delegate _outside_ the scope
of the class. So instead of...
Public Class Something
Public Event Click(X As Integer, Y As Integer)
End Class
...use...
Public Delegate ClickEventHandler(X As Integer, Y As Integer)
Public Class Something
Public Event Click As ClickEventHandler
End Class
HTH.
--
David.
Quote:
> Has anyone gotten events to fire from one VB project into another?
> I have a Windows Forms project that has an object variable declared
> WithEvents. In a separate project (library) I have a class that raises
that
> event.
> The event is never caught by my event handler however. I have talked to a
> couple other people who are having similar problems.
> Is this a Beta 1 bug? Has anyone gotten this to work in general?
> Thanks
> Rocky
> Rockford Lhotka