Ошибка CS0123: нет перегрузки для 'form1_load' соответствует делегату 'eventhandler'
---Я хочу нарисовать круг внутри прямоугольника, но есть одна проблема, которую я не могу решить.
---Я новичок в программировании, поэтому мне нужна помощь.
это основной код:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Printing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace DrawCircleRectangle { public partial class Form1 : Form { public Form1() { InitializeComponent(); } //pen is used for border color Pen red = new Pen(Color.Red); Pen green = new Pen(Color.Green); //To fill the shape System.Drawing.SolidBrush fillRed = new System.Drawing.SolidBrush(Color.Red); System.Drawing.SolidBrush fillYelloq = new System.Drawing.SolidBrush(Color.Yellow); Rectangle rectangle = new Rectangle(50, 50, 220, 90); Rectangle circle = new Rectangle(50,50,220,90); public void Form1_Load(object sender, PrintPageEventArgs e) { using (Graphics g = e.Graphics) { g.DrawRectangle(red, rectangle); //draw rectangle g.DrawEllipse(green, circle); //draw circle } } } } ---But the problem is Form1.Designer using System; namespace DrawCircleRectangle { partial class Form1 { /// <summary> /// Required designer variable. /// private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// /// <param name="disposing" />true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.SuspendLayout(); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); this.Name = "Form1"; this.Text = "Form1"; NewMethod(); this.ResumeLayout(false); } private void NewMethod() { Form1 form11 = this; this.Load += new EventHandler(form11.Form1_Load); } #endregion } } ---I have bolded where the error occurred -- No overload for 'Form1_Load' matches delegate 'EventHandler' What I have tried: I have tried some solutions but they didn't work