I am trying to set winform OnMouseDown event to a method I defined called SelectMouseDown.
The method is defined as follows:
method Maker.SelectMouseDown(Sender: Object; e: System.Windows.Forms.MouseEventArgs);
and I am trying to do the following:
OnMouseDown += System.Windows.Forms.MouseEventHandler(@Self.SelectMouseDown);
The compiler throws the following error message: "There is no overloaded method "OnMouseDown" with 0 parameters."
What am I doing wrong? How do you set events during runtime?
Gracias por adelantado,
preguntado el 08 de noviembre de 11 a las 13:11
new, and the event is named
MouseDown as Marc Gravell pointed out:
MouseDown += new System.Windows.Forms.MouseEventHandler(@Self.SelectMouseDown);
I don't know about Delphi, but in C# the compiler can create the delegate automatically:
MouseDown += @Self.SelectMouseDown;