Hi,
If you want to creare totally new custom event handler,
First create a public event class like this
inside your other code where you want to rise these events., define one parametirised delegate "clsCustomEvenArgs " as an argument. Also define one event like this.Code:public class clsCustomEvenArgs : EventArgs { public string m_sEvent1; public string m_sEvent2; public clsEventTableArgs(string sEvent1, string sEvent2) { m_sEvent1= sEvent1; m_sEvent2= sEvent2; } } //This is public event handler. sEvent1,sEvent2 are events which you want to send *** argumets.
Inside your Timer codeCode:public delegate void EventTable(object sender, clsCustomEvenArgs e); public event EventTable evtYourEvent;//For Custom events
This will doCode:private void timer1_Tick(object sender, EventArgs e) { if(/*your condition) { clsCustomEvenArgs args = new clsCustomEvenArgs ((string)arg1, (string)arg2);//Pass your arguments evtYourEvent(this, args);//For custom event data } }
Regards
Ravi.Battula




Reply With Quote