The purpose of this program is to allow a user to light up a number of LEDs on a panel by choosing them on screen. I have an array of buttons built where currently, a user has to click all of the buttons individually. The array holds 1536 LEDs, thats a lot of clicks. I'd like the user to be able to hold down the mouse button and light up any LEDs they cross. I want to say something like:
buttonArray[row, column].MouseLeave += new System.Windows.Forms.MouseEventHandler(ClickButton);
And then have a routine like:
private void ClickButton(Object sender, System.Windows.Forms.MouseEventArgs e)
{
if (e.Button==MouseButtons.Left)
{
//blah blah
}
}
That will trigger any time the users mouse goes over a button, and then i will check to see if they were holding down the button. Right now I am getting this error:
Error 1 Cannot implicitly convert type 'System.Windows.Forms.MouseEventHandler' to 'System.EventHandler'.
Seems like I don't have the right match of delegate and handler, or that I'm not understanding the namespace thing... kinda new to C#. I've stumbled around on the MSDN for a while now and am finding plenty of examples that look just like mine that work.