I have this error:
Error 1 ‘johny.Form1’ does not contain a definition for ‘Form1_Load’
and no extension method ‘Form1_Load’ accepting a first argument of
type ‘johny.Form1’ could be found (are you missing a using directive
or an assembly reference?)
This is my code from the form’s designer:
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(456, 411);
this.Controls.Add(this.l6);
this.Controls.Add(this.label1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
The error is from this line:
this.Load += new System.EventHandler(this.Form1_Load);
The error is telling you that you don’t have a
Form1_Loadmethod in yourForm1class, and you are trying to use one.Delete that line if you don’t need to do any initialization when the form first loads, or ensure you do have one (that conforms to the signature of the
EventHandlerdelegate).