hi everyone,
i'm new in c#, so i have some questions:
i have this piece of code:
Graphics gfx = this.CreateGraphics();
Pen myPen = new Pen(Color.Azure, 1.0f);
Rectangle myRec = new Rectangle(10, 10, 30, 30);
gfx.DrawRectangle(myPen, myRec);
and i want the rectangle myRec appear on the form1 when i press Ctrl+F5. Where should i put it?? On the Form1.cs or on the Form1.Designer.cs?? What is the difference? And i don't understand the methods:
protected override void OnPaint(PaintEventArgs e) {}
private void Form1_Load(object sender, EventArgs e){}
private void Form1_Paint(object sender, EventArgs e){}
Are they events or what? Why when i put that piece of code in Form1_Load or Form1_Paint nothing happens? In which cases i should use each of them? What is the purpose of each of them?
I will be very glad if somebody gives me clear explanation! Sorry if questions are too stupid...