I have the following EventHandler to which I have added the MusicNote music parameter:
public void PlayMusicEvent(object sender, EventArgs e,MusicNote music) { music.player.Stop(); System.Timers.Timer myTimer = (System.Timers.Timer)sender; myTimer.Stop(); }
I need to add a handler to Timer like this:
myTimer.Elapsed += new ElapsedEventHandler(PlayMusicEvent(this, e, musicNote));
but get an error:
"Expected Method Name"
EDIT: In this case, I just pass the e from the method that contains this piece of code, how can I pass the EventArgs timer?
parameter-passing c # event-handling
Matt Dec 27 '11 at 11:43 2011-12-27 11:43
source share