Help - Search - Members - Calendar
Full Version: C# - No overload for 'Form1_Load' ...
Pixel2Life Forum > Help Section > Desktop Programming
Red0z
Hey guys, i'm trying to get this to work, but whenever i add 'FormClosingEvent f' to

  public void Form1_Load(object sender, EventArgs e, FormClosingEventArgs f)
  {
  f.Cancel = true;
  base.OnClosing(f);
  }



i get the error 'Error 1 No overload for 'Form1_Load' matches delegate 'System.EventHandler'



So what could the problem be ? 

Do i need to add something to 'this.Load += new System.EventHandler(this.Form1_Load);' ? or what? smile.gif



Thank you in advance!! smile.gif

Demonslay
I don't do much C#, but I can tell you the error means there isn't a function of that name with those arguments that is meant to be overloaded. To me, it means if you aren't trying to overload a function already defined with the language, then you may be declaring it incorrectly elsewhere. Make sure all types for your arguments match what they should be.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.