When starting the program, the coordinate axes should be drawn in the PictureBox. In the Form1 constructor, I wrote the following code:
Graphics g = pictureBox1.CreateGraphics(); g.Clear(Color.White); g.DrawLine(new Pen(Color.Black, 4), pictureBox1.Width / 2, 0, pictureBox1.Width / 2, pictureBox1.Height); g.DrawLine(new Pen(Color.Black, 4), 0, pictureBox1.Height / 2, pictureBox1.Width, pictureBox1.Height / 2); But at startup nothing happens ... I tried to cram the same code into an event of the form Load , effect 0. What am I doing wrong?