Hi.
hmm trying to grasp this once again.
I have:
MainForm
subclasses
I want the mainform to raise an event so the subclasses can "hear it" and act upon it.
I know how to do this for the Mainform, so when an event is raised in the subclasses, the UI gets called and acts upon it. No doubt it shouldnt be different and I've tried to "reverse" the way so that the subclasses can hear the event but not going to plan.
This is what I have:
MainForm:
Code:public delegate void SendNewNotification(MyClass notification) public event SendNewNotification OnEventSendNewNotification;
subclass:
Code:public delegate void SendNewNotification(MyClass notification) public event SendNewNotification OnEventSendNewNotification; MainForm.SendNewNotification theNewNotification; .. .. .. this.OnEventSendNewNotification += new SendNewNotification(Myclass2_OnEventSendNewNotification) //it also inserts this event method in this class for me to do my own thing this.theNewNotification = new MainForm.SendNewNotification(OnEventSendNewNotification);
When time comes for the UI to raise this event, how do I do it? Everytime I try to do it "if (this.OnEventSendNewNotification != null){}" it always tells me it is null therefore it wont raise the event.





any chance of a regain? 
Reply With Quote