Hello
I have read that events can be raised the same way as methods. Well it works for my custom events (I create a delegate, the event and I am able to raise the event by calling it).
However I am not able to manually raise events like MouseClick and other, it keeps saying that it must appear on the left side of the += operator. What is the problem?
Hello I have read that events can be raised the same way as methods.
Share
While I am certain you’ll get other answers more informative than this one, basically you can’t “raise” an event outside the class that contains it. MSDN has this to say about events
If you wanted to literally raise the event for, say, a Windows Forms Control MouseClick, you’d have to create a subclass of that control and either invoke base.OnMouseClick() or override it.