Quick Event question

  • Thread starter Thread starter Doug
  • Start date Start date
D

Doug

Hi, I'm having a mind block...how do i do this?

I have an Event that I want to raise called Event1(object sender,
MyEventArgs e)

I want to raise it in another event where the parameters (EventArgs) are
different. How do I do this?

So here is what i have:

private void KeyPressed (object sender, KeyPressedEventArgs e)
{
switch (e.Keys)
{
......
case "X":
//I want to raise my Event1(sender,????);
}

}

private void Event1(object sender, MyEventArgs e)
{
....
//Do something
}

Doug
 
HI Doug

You can pass in the existing e parameter if
event1(sender,EventArg type), because it accept a base class EventArgs from
which all or most event arguments should derive from

or you can create the eventargument class that is specific to the event
event1(sender,new MyCustomeEventArgs(??,??))

Henk
 
Back
Top