As given here
http://msdn.microsoft.com/en-us/library/0ecakwbz.aspx[
^]
An event can be raised only from the declaration space in which it is declared. Therefore, a class cannot raise events from any other class, even one from which it is derived.
May be you are trying to raise an event from other class.
But as for as the
OutlookBar
AddIcon
routine is concerned, it assigns the instance of a
EventHandler
delegate which is passed as parameter to the
Click
event of the label. You need not raise the event. When the label is clicked the
Click
event of the label is raised by the label control and the instance of
EventHandler
supplied in the
AddIcon
routine is invoked.
So, don't raise the event yourself, only supply an instance of the
EventHandler
delegate as a parameter as already given in the demo application given the referred article.