Winform使用Drawline生成直线失败了是为什么

请问一下,我想在一个黑色背景的PictureBox里生成白色直线,用Graphics的Drawline写了一个,运行的时候没有显示出来是为什么啊
以下是代码

using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TestDrawing
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Graphics g = pictureBox1.CreateGraphics();
            g.DrawLine(new Pen(Color.White,2), 0, pictureBox1.Height / 2, pictureBox1.Width, pictureBox1.Height / 2);
            g.Dispose();
        }
    }
}

        public Form1()
        {
            InitializeComponent();
            this.Load += Form1_Load;
            this.pictureBox1.Paint += PictureBox1_Paint;
        }

        private void PictureBox1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            g.DrawLine(new Pen(Color.White, 2), 0, pictureBox1.Height / 2, pictureBox1.Width, pictureBox1.Height / 2);
        }

你检查一下你传入的参数是否准确