Re: Event question
- From: Jianwei Sun <jsunnewsgroup@xxxxxxxxx>
- Date: Mon, 18 Jul 2005 09:07:14 -0400
Rainer Queck wrote:
Hi,
in a base class I have declared the following event handler:
public abstract class MyBaseClass : :MarshalByRefObject { .... public event EventHandler OnMsgSent; ... }
In a derived class I try to call this event in the following way:
public override void MsgSent() { if(OnMsgSent != null) { GbMessageEventArgs e = new GbMessageEventArgs(this); e.InfoString = "Message was successfully sent!"; OnMsgSent(this,e); } }
but when I trie to compile this, I get the following error message: "The event ,<my namespace>.<base class>.OnMsgSent' can only appear on the left hand side of += ...."
[I have doubt that this error appears where you register the event, can you show us how you register the event too].
What is it I am doing wrong?
Thanks for hints.
Rainer
.
- Follow-Ups:
- Re: Event question
- From: Rainer Queck
- Re: Event question
- References:
- Event question
- From: Rainer Queck
- Event question
- Prev by Date: Empty string
- Next by Date: Re: XML question
- Previous by thread: Re: Event question
- Next by thread: Re: Event question
- Index(es):